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
var Mocha = require("qunit-mocha-ui"),
mocha = new Mocha({ui:"qunit-mocha-ui", reporter:"spec"});
mocha.addFile("....js");
mocha.run(function(failures){
process.exit(failures);
});
throws an error:
suite.on('pre-require', function(context){
^
TypeError: Object #<Object> has no method 'on'
at new module.exports (...\node_modules\qunit-mocha-ui\qunit-mocha-ui.js:51:9)
The text was updated successfully, but these errors were encountered:
I think the first line would need to be: var Mocha = require("mocha");
if you don't already have a reference to the Mocha object.
There's actually recently been movement to get alternate ui plugins like this one supported by mocha out of the box, though. See: mochajs/mocha#851 and mochajs/mocha#1022
I should probably take some time and see if I can write a new, more succinct version of the documentation with the new support from mocha.
The code on https://github.com/itaylor/qunit-mocha-ui#usage cannot run; it doesn't set up a
Mocha
variable anywhere, and rewriting it to:throws an error:
The text was updated successfully, but these errors were encountered: