alex-seville / blanket

blanket.js is a simple code coverage library for javascript. Designed to be easy to install and use, for both browser and nodejs.
http://blanketjs.org
Other
1.4k stars 177 forks source link

Mocha Require Blanket #355

Open ButuzGOL opened 10 years ago

ButuzGOL commented 10 years ago

Have this error Uncaught TypeError: Object [object global] has no method 'suiteURL' mocha.js:2585

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <meta content="IE=edge,chrome=1", http-equiv="X-UA-Compatible" />
    <meta content="width=device-width", name="viewport" />

    <title>Gone in Sixty Seconds Test Runner</title>

    <link rel="stylesheet" href="/bower_components/mocha/mocha.css">
    <script src="/bower_components/mocha/mocha.js"></script>
    <script src="/bower_components/requirejs/require.js"></script>
    <script data-cover-only="/app" src="/bower_components/blanket/dist/qunit/blanket.js"></script>
    <script type="text/javascript" src="/bower_components/blanket/src/adapters/mocha-blanket.js"></script>
  </head>
  <body>
    <div id="mocha"></div>
    <div id="test"></div>

    <script>
      window.mocha.setup('bdd');
    </script>

    <script src="/app/main.js"></script>
  </body>
</html>
require([
  '../test/lib/error-handler',
  '../test/lib/utils',
  '../test/lib/support',

  '../test/helpers/application',
  '../test/helpers/sessions',

  '../test/application',
  '../test/mediator',

  '../test/controllers/base/controller',
  '../test/controllers/pages',
  '../test/controllers/errors',
  '../test/controllers/sessions',

  '../test/models/base/model',
  '../test/models/base/collection',
  '../test/models/user',

  '../test/views/layout',
  '../test/views/base/view',
  '../test/views/base/collection',
  '../test/views/base/page',
  '../test/views/base/form',
  '../test/views/site',
  '../test/views/header',
  '../test/views/footer',
  '../test/views/messages',
  '../test/views/errors/403-page',
  '../test/views/errors/404-page',
  '../test/views/errors/500-page',
  '../test/views/pages/home-page',
  '../test/views/sessions/new-form'
], function() {
  'use strict';

  if (window.mochaPhantomJS) {
    window.mochaPhantomJS.run();
  } else {
    window.mocha.run();
  }
});

Project link

chrisabrams commented 10 years ago

I also have this issue...any luck?

geekdave commented 10 years ago

Downgrading mocha to 1.12.1 resolved this issue for me.

alex-seville commented 10 years ago

I'm debating whether I should lock down the mocha version in package.json. This error is odd, I'm not sure what changed in mocha to cause it.

gamtiq commented 10 years ago

I also have this error when using one of recent versions of mocha.js. By the way, I have found that the problem can be fixed by replacing the following line in mocha-blanket.js

originalReporter(runner);

onto

new originalReporter(runner);
geekdave commented 10 years ago

Looks like this has been resolved in https://github.com/alex-seville/blanket/pull/356

fearphage commented 9 years ago

This issue should be resolved in the development branch.

Use the following in your package.json file to refer to the branch as a dependency:

"blanket": "alex-seville/blanket#development"

Please reopen the issue if you're still experiencing problems.