mirror of
https://github.com/seejohnrun/haste-server
synced 2025-07-30 09:08:22 -07:00
Added node modules
This commit is contained in:
parent
ca9d4c18f7
commit
d1e0644a4e
575 changed files with 77900 additions and 6 deletions
60
node_modules/mocha/lib/interfaces/exports.js
generated
vendored
Normal file
60
node_modules/mocha/lib/interfaces/exports.js
generated
vendored
Normal file
|
@ -0,0 +1,60 @@
|
|||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var Suite = require('../suite')
|
||||
, Test = require('../test');
|
||||
|
||||
/**
|
||||
* TDD-style 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(){
|
||||
*
|
||||
* }
|
||||
* }
|
||||
* };
|
||||
*
|
||||
*/
|
||||
|
||||
module.exports = function(suite){
|
||||
var suites = [suite];
|
||||
|
||||
suite.on('require', visit);
|
||||
|
||||
function visit(obj) {
|
||||
var suite;
|
||||
for (var key in obj) {
|
||||
if ('function' == typeof obj[key]) {
|
||||
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:
|
||||
suites[0].addTest(new Test(key, fn));
|
||||
}
|
||||
} else {
|
||||
var suite = Suite.create(suites[0], key);
|
||||
suites.unshift(suite);
|
||||
visit(obj[key]);
|
||||
suites.shift();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue