Skip to content

Instantly share code, notes, and snippets.

@argami
Created July 25, 2012 14:34
Show Gist options
  • Save argami/3176485 to your computer and use it in GitHub Desktop.
Save argami/3176485 to your computer and use it in GitHub Desktop.
Error on Mocha
require('should');
function a() {
throw new Error("Oops");
return 1;
}
describe('MyLibrary', function(){
it('handles errors', function(){
a().should.equal(1);
});
});
@argami
Copy link
Author

argami commented Jul 25, 2012

☹  node_modules/mocha/bin/mocha test                                                                                                                            ruby-1.9.3-p194 master 3decc64 ✗

  .

  ✖ 1 of 1 tests failed:

  1) MyLibrary handles errors:
     Error: Oops
      at a (/Users/argami/Documents/trabajo/projects/ooon/test.js:4:9)
      at Context.<anonymous> (/Users/argami/Documents/trabajo/projects/ooon/test.js:10:7)
      at Test.run (/Users/argami/Documents/trabajo/projects/ooon/node_modules/mocha/lib/runnable.js:158:32)
      at Runner.runTest (/Users/argami/Documents/trabajo/projects/ooon/node_modules/mocha/lib/runner.js:270:10)
      at /Users/argami/Documents/trabajo/projects/ooon/node_modules/mocha/lib/runner.js:314:12
      at next (/Users/argami/Documents/trabajo/projects/ooon/node_modules/mocha/lib/runner.js:198:14)
      at /Users/argami/Documents/trabajo/projects/ooon/node_modules/mocha/lib/runner.js:207:7
      at next (/Users/argami/Documents/trabajo/projects/ooon/node_modules/mocha/lib/runner.js:157:23)
      at Array.0 (/Users/argami/Documents/trabajo/projects/ooon/node_modules/mocha/lib/runner.js:175:5)
      at EventEmitter._tickCallback (node.js:192:40)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment