Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

https://github.com/itaylor/qunit-mocha-ui#usage does not work as described #8

Open
Pomax opened this issue Dec 16, 2013 · 1 comment

Comments

@Pomax
Copy link

Pomax commented Dec 16, 2013

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:

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)
@itaylor
Copy link
Owner

itaylor commented Dec 16, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants