Skip to content

Commit

Permalink
Ensure brout is required before mocha
Browse files Browse the repository at this point in the history
  • Loading branch information
m90 authored and mantoni committed May 23, 2021
1 parent 3fa740a commit 4382056
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
4 changes: 3 additions & 1 deletion lib/mocaccino.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ module.exports = function (b, opts) {
var self = this;
listener.then(function (err, res) {
if (!err) {
setupSource = (res.mocha || '') + res.setup;
setupSource = (opts.node ? '' : 'require(\'brout\');\n')
+ (res.mocha || '')
+ res.setup;
self.push(createSetupEntry());
}
next();
Expand Down
2 changes: 0 additions & 2 deletions lib/setup-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
*/
'use strict';

require('brout');

Mocha.reporters.Base.window.width = JSON.parse('{{WINDOW_WIDTH}}');
Mocha.reporters.Base.symbols.dot = '.';
var grep = '{{GREP}}';
Expand Down
14 changes: 0 additions & 14 deletions test/mocaccino-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,27 +274,13 @@ describe('plugin', function () {
run('chromium', [], b, passOutputAssert(done));
});

it('passes --brout test', function (done) {
var b = browserify();
b.add('./test/fixture/test-pass');
b.plugin(mocaccino);
run('chromium', ['--brout'], b, passOutputAssert(done));
});

it('fails test', function (done) {
var b = browserify();
b.add('./test/fixture/test-fail');
b.plugin(mocaccino);
run('chromium', [], b, failOutputAssert(done));
});

it('fails --brout test', function (done) {
var b = browserify();
b.add('./test/fixture/test-fail');
b.plugin(mocaccino);
run('chromium', ['--brout'], b, failOutputAssert(done));
});

it('filters tests when grep is set', function (done) {
var b = browserify();
b.add('./test/fixture/test-grep');
Expand Down

0 comments on commit 4382056

Please sign in to comment.