now running mocha tests properly
This commit is contained in:
parent
2fbcb58078
commit
8dcbe98c60
10
index.js
10
index.js
@ -107,13 +107,7 @@ var NpmtsTests;
|
||||
plugins.fs.ensureDirSync(paths.testDir); //make sure that mocha has a directory to look for tests
|
||||
plugins.beautylog.info("Now running mocha tests");
|
||||
var mocha = new plugins.mocha(); // Instantiate a Mocha instance.
|
||||
// Add each .js file to the mocha instance
|
||||
plugins.fs.readdirSync(paths.testDir).filter(function (file) {
|
||||
// Only keep the .js files
|
||||
return file.substr(-3) === '.js';
|
||||
}).forEach(function (file) {
|
||||
mocha.addFile(plugins.path.join(paths.testDir, file));
|
||||
});
|
||||
mocha.addFile(plugins.path.join(paths.testDir, "test.js"));
|
||||
// Run the tests.
|
||||
mocha.run(function (failures) {
|
||||
process.on('exit', function () {
|
||||
@ -145,7 +139,7 @@ var NpmtsPromisechain;
|
||||
/// <reference path="./npmts.default.ts" />
|
||||
/// <reference path="./npmts.tests.ts" />
|
||||
/// <reference path="./npmts.promisechain.ts" />
|
||||
console.log("** starting NPMTS **");
|
||||
console.log("**** starting NPMTS ****");
|
||||
var plugins = NpmtsPlugins.init();
|
||||
var paths = NpmtsPaths.init();
|
||||
var promisechain = NpmtsPromisechain.init();
|
||||
|
@ -1 +1 @@
|
||||
|
||||
console.log("**** starting test ****");
|
||||
|
@ -1 +1,2 @@
|
||||
console.log("**** starting test ****");
|
||||
//# sourceMappingURL=test.js.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":""}
|
||||
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC"}
|
@ -0,0 +1 @@
|
||||
console.log("**** starting test ****");
|
@ -8,7 +8,7 @@
|
||||
/// <reference path="./npmts.default.ts" />
|
||||
/// <reference path="./npmts.tests.ts" />
|
||||
/// <reference path="./npmts.promisechain.ts" />
|
||||
console.log("** starting NPMTS **")
|
||||
console.log("**** starting NPMTS ****")
|
||||
var plugins = NpmtsPlugins.init();
|
||||
var paths = NpmtsPaths.init();
|
||||
var promisechain = NpmtsPromisechain.init();
|
||||
|
@ -4,20 +4,11 @@ module NpmtsTests {
|
||||
var done = plugins.q.defer();
|
||||
plugins.fs.ensureDirSync(paths.testDir); //make sure that mocha has a directory to look for tests
|
||||
plugins.beautylog.info("Now running mocha tests");
|
||||
|
||||
var mocha = new plugins.mocha(); // Instantiate a Mocha instance.
|
||||
|
||||
// Add each .js file to the mocha instance
|
||||
plugins.fs.readdirSync(paths.testDir).filter(function(file){
|
||||
// Only keep the .js files
|
||||
return file.substr(-3) === '.js';
|
||||
|
||||
}).forEach(function(file){
|
||||
mocha.addFile(
|
||||
plugins.path.join(paths.testDir, file)
|
||||
);
|
||||
});
|
||||
|
||||
// Run the tests.
|
||||
mocha.addFile(
|
||||
plugins.path.join(paths.testDir, "test.js")
|
||||
);
|
||||
mocha.run(function(failures){
|
||||
process.on('exit', function () {
|
||||
process.exit(failures);
|
||||
|
Loading…
Reference in New Issue
Block a user