aboutsummaryrefslogtreecommitdiff
path: root/node_modules/mocha/lib/interfaces/exports.js
diff options
context:
space:
mode:
authorKumar Damani <kumar.damani@mail.utoronto.ca>2019-04-16 13:17:06 +0000
committerKumar Damani <kumar.damani@mail.utoronto.ca>2019-04-16 13:17:06 +0000
commitdc46b87abee1e441c07524ddde67fd902a919336 (patch)
tree13eba08b8655dfd78e9600ec5f612011a0bf3b35 /node_modules/mocha/lib/interfaces/exports.js
parent26f4b38e9e5a202756a7c33abc775aea2617aeaf (diff)
added some dependencies to package.json
Diffstat (limited to 'node_modules/mocha/lib/interfaces/exports.js')
-rw-r--r--node_modules/mocha/lib/interfaces/exports.js61
1 files changed, 0 insertions, 61 deletions
diff --git a/node_modules/mocha/lib/interfaces/exports.js b/node_modules/mocha/lib/interfaces/exports.js
deleted file mode 100644
index 7db6e47..0000000
--- a/node_modules/mocha/lib/interfaces/exports.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * Module dependencies.
- */
-
-var Suite = require('../suite');
-var Test = require('../test');
-
-/**
- * Exports-style (as Node.js module) interface:
- *
- * exports.Array = {
- * '#indexOf()': {
- * 'should return -1 when the value is not present': function() {
- *
- * },
- *
- * 'should return the correct index when the value is present': function() {
- *
- * }
- * }
- * };
- *
- * @param {Suite} suite Root suite.
- */
-module.exports = function(suite) {
- var suites = [suite];
-
- suite.on('require', visit);
-
- function visit(obj, file) {
- var suite;
- for (var key in obj) {
- if (typeof obj[key] === 'function') {
- var fn = obj[key];
- switch (key) {
- case 'before':
- suites[0].beforeAll(fn);
- break;
- case 'after':
- suites[0].afterAll(fn);
- break;
- case 'beforeEach':
- suites[0].beforeEach(fn);
- break;
- case 'afterEach':
- suites[0].afterEach(fn);
- break;
- default:
- var test = new Test(key, fn);
- test.file = file;
- suites[0].addTest(test);
- }
- } else {
- suite = Suite.create(suites[0], key);
- suites.unshift(suite);
- visit(obj[key], file);
- suites.shift();
- }
- }
- }
-};