jasmine-style 'expect' calls for mocha and other test frameworks

npm install expectations
94 downloads in the last day
378 downloads in the last week
1 549 downloads in the last month

Jasmine-style expectations for node.js & the browser

This is a standalone package that supplies jasmine style expect(foo).toEqual(bar);-style expectations.

Designed for use in mocha, but suitable for use in any test framework.


  • NodeJS: npm install expectations
  • Browser: Download manually, or bower install expectations



require('expectations');    // exports a global, so use anywhere

From Mocha (on commandline or add to test/mocha.opts):

--require expectations

In browser:

<script src="expectations.js"></script>


We aim to support the majority of the jasmine expect API, but there are likely things missing. Pull Requests (with tests!) graciously accepted.

npm loves you