-
-
Save pascalopitz/3134403 to your computer and use it in GitHub Desktop.
Mocha command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
requirejs = require('requirejs').config({ | |
baseUrl: (function(){ | |
var dir_tokens = __dirname.split('/'); | |
dir_tokens.pop(); | |
dir_tokens.push('lib'); | |
return dir_tokens.join('/'); | |
})(), | |
//Pass the top-level main.js/index.js require | |
//function to requirejs so that node modules | |
//are loaded relative to the top-level JS file. | |
nodeRequire: require | |
}); // LiveMvc uses require.js module format | |
expect = require('chai').expect; // Make expect function global | |
assert = require('chai').assert | |
if (typeof window == "undefined") { | |
// making the document object global | |
document = require("jsdom").jsdom("<html><head></head><body></body></html>", null, { | |
features:{ | |
QuerySelector:true | |
} | |
}); | |
// making the window object global | |
window = document.createWindow(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./node_modules/.bin/mocha \ | |
--bail \ | |
--require support/beforeTest.js \ | |
--reporter spec \ | |
--ui tdd \ ${NAME_OF_TEST_FILE} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment