Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

globals is not a mocha method in browser mode #442

Closed
maraujop opened this Issue · 5 comments

5 participants

@maraujop

According to the docs about browser support

You can do mocha.globals(['foo', 'bar'])

This is what you get when you do so:

Uncaught TypeError: Object function Mocha(options) {
  options = options || {};
  this.files = [];
  this.options = options;
  this.grep(options.grep);
  this.suite = new exports.Suite('', new exports.Context);
  this.ui(options.ui);
  this.reporter(options.reporter);
  if (options.timeout) this.suite.timeout(options.timeout);
} has no method 'globals'

Cheers,
Miguel

@emilecantin

You can do this instead (coffeescript):

    # Test setup
    mocha.setup
      ui: 'bdd'
      globals: [ 'jade' ]
@maraujop

Thank you @emilecantin for the tip.

@vjpr

Docs need updating here.

@brianmhunt

Thanks @emilecantin! An update to the docs would be handy.

@tj
Owner
tj commented

we need to work on making the node / browser side apis identical, but I think we have an issue for that already

@tj tj closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.