tscoverage/ts/npmts.tests.ts

19 lines
645 B
TypeScript
Raw Permalink Normal View History

2016-01-30 03:57:24 +00:00
/// <reference path="./index.ts" />
module NpmtsTests {
2016-01-30 04:29:54 +00:00
export var run = function() {
var done = plugins.q.defer();
2016-01-31 21:24:57 +00:00
plugins.fs.ensureDirSync(paths.testDir); //make sure that mocha has a directory to look for tests
2016-01-30 04:29:54 +00:00
plugins.beautylog.info("Now running mocha tests");
2016-01-30 03:57:24 +00:00
2016-01-31 23:24:08 +00:00
var mocha = new plugins.mocha(); // Instantiate a Mocha instance.
mocha.addFile(
plugins.path.join(paths.testDir, "test.js")
);
2016-01-30 03:57:24 +00:00
mocha.run(function(failures){
process.on('exit', function () {
process.exit(failures);
});
});
2016-01-30 04:29:54 +00:00
return done.promise;
2016-01-30 03:57:24 +00:00
}
}