You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like the runtime formats the error message in a different way for vm.runInContext and mocha seems to have trouble and doesn't print the message at all.
Test:
varvm=require('vm');require('should');describe("BDD framework",function(){it("throws an undefined error",function(){//(function() {undefined();//}).should.throw(/undefined is not a function/);});it("throws an undefined error from a runInContext",function(){//(function() {vm.runInContext('undefined();',vm.createContext({}),{showErrors: true});//}).should.throw(/undefined is not a function/);});});
Mocha output:
0 passing (19ms)
2 failing
1) BDD framework throws an undefined error:
TypeError: undefined is not a function
at Context.<anonymous> (spec/mocha-problem-spec.js:7:13)
2) BDD framework throws an undefined error from a runInContext:
Error: the error {} was thrown, throw an Error :)
Jasmine output:
Failures:
1) BDD framework throws an undefined error
Message:
TypeError: undefined is not a function
Stack:
TypeError: undefined is not a function
at Object.<anonymous> (/Users/mikebush/Workspace/spec-verify/spec/mocha-problem-spec.js:7:13)
2) BDD framework throws an undefined error from a runInContext
Message:
TypeError: evalmachine.<anonymous>:1
undefined();
^
undefined is not a function
Stack:
evalmachine.<anonymous>:1
undefined();
^
TypeError: undefined is not a function
at evalmachine.<anonymous>:1:1
at Object.exports.runInContext (vm.js:64:17)
at Object.<anonymous> (/Users/mikebush/Workspace/spec-verify/spec/mocha-problem-spec.js:13:16)
The text was updated successfully, but these errors were encountered:
looks like vm.runInContext won't throw an actual Error for reasons unknown to me. if anyone has any further information on why (or if this is some sort of bug), I'd like to know...
It looks like the runtime formats the error message in a different way for vm.runInContext and mocha seems to have trouble and doesn't print the message at all.
Test:
Mocha output:
Jasmine output:
The text was updated successfully, but these errors were encountered: