diff options
Diffstat (limited to 'tests/lib/mocha-3.1.0/test/integration/fixtures/regression/1794/simple-ui.js')
-rw-r--r-- | tests/lib/mocha-3.1.0/test/integration/fixtures/regression/1794/simple-ui.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/lib/mocha-3.1.0/test/integration/fixtures/regression/1794/simple-ui.js b/tests/lib/mocha-3.1.0/test/integration/fixtures/regression/1794/simple-ui.js new file mode 100644 index 0000000000..1fdf33d665 --- /dev/null +++ b/tests/lib/mocha-3.1.0/test/integration/fixtures/regression/1794/simple-ui.js @@ -0,0 +1,27 @@ +var path = '../../../../../lib/', + Mocha = require(path + 'mocha'); + Suite = require(path + 'suite'), + Test = require(path + 'test'); + +/** + * A simple UI that only exposes a single function: test + */ +module.exports = Mocha.interfaces['simple-ui'] = function(suite) { + suite.on('pre-require', function(context, file, mocha) { + var common = require(path + 'interfaces/common')([suite], context); + + context.run = mocha.options.delay && common.runWithSuite(suite); + + /** + * Describes a specification or test-case with the given `title` + * and callback `fn` acting as a thunk. + */ + context.test = function(title, fn) { + var test = new Test(title, fn); + test.file = file; + suite.addTest(test); + + return test; + }; + }); +}; |