Skip to content

Commit

Permalink
add proof-of-concept for #956
Browse files Browse the repository at this point in the history
  • Loading branch information
boneskull committed Sep 12, 2015
1 parent f023018 commit 3cdd4a0
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ test-mocha:
--reporter $(REPORTER) \
test/mocha

test-auto:
@node test/auto/bdd.js

non-tty:
@./bin/mocha \
--reporter dot \
Expand Down
19 changes: 19 additions & 0 deletions auto/bdd.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';

const Mocha = require('../lib/mocha');

module.exports = function setup(opts) {
opts = opts || {};
opts.ui = opts.ui || 'bdd';

const mocha = new Mocha(opts);
const ctx = {};

process.on('beforeExit', function() {
mocha.run(process.exit);
});

mocha.suite.emit('pre-require', ctx, null, mocha);

return ctx;
};
14 changes: 14 additions & 0 deletions test/auto/bdd.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';

var mocha = require('../../auto/bdd')({
reporter: 'spec'
});
var describe = mocha.describe;
var it = mocha.it;
var assert = require('assert');

describe('nodeability', function() {
it('should make this assertion', function() {
assert(true);
});
});

0 comments on commit 3cdd4a0

Please sign in to comment.