restructure

This commit is contained in:
2016-01-30 04:57:24 +01:00
parent f83eb035c2
commit 7c6b5afd5f
23 changed files with 48 additions and 2329 deletions

View File

@ -5,6 +5,8 @@
/// <reference path="./npmts.options.ts" />
/// <reference path="./npmts.custom.ts" />
/// <reference path="./npmts.default.ts" />
/// <reference path="./npmts.tests.ts" />
/// <reference path="./npmts.promisechain.ts" />
var plugins = NpmtsPlugins.init();
var paths = NpmtsPaths.init();

View File

@ -39,7 +39,7 @@ module NpmtsDefault {
.pipe(plugins.g.typescript({
out: "test.js"
}))
.pipe(plugins.gulp.dest(paths.cwd))
.pipe(plugins.gulp.dest(paths.testDir))
});
plugins.gulp.task("defaultCleanup",function(cb){

View File

@ -6,6 +6,7 @@ module NpmtsPaths {
paths.tsd = plugins.path.join(paths.cwd,"ts/tsd.json");
paths.indexTS = plugins.path.join(paths.cwd,"ts/index.ts");
paths.testTS = plugins.path.join(paths.cwd,"ts/test.ts");
paths.testDir = plugins.path.join(paths.cwd,"test/");
return paths;
}
}

View File

@ -3,6 +3,7 @@ module NpmtsPlugins {
export var init = function() {
var plugins = {
beautylog: require("beautylog"),
fs: require("fs"),
gulp: require("gulp"),
g: {
insert: require("gulp-insert"),
@ -12,7 +13,9 @@ module NpmtsPlugins {
},
mergeStream: require("merge2"),
mocha: require("mocha"),
path: require("path"),
q:require("q"),
smartcli: require("smartcli")
};
return plugins;

6
ts/npmts.promisechain.ts Normal file
View File

@ -0,0 +1,6 @@
/// <reference path="./index.ts" />
module NpmtsPromisechain {
export var init = function(){
}
}

27
ts/npmts.tests.ts Normal file
View File

@ -0,0 +1,27 @@
/// <reference path="./index.ts" />
module NpmtsTests {
export var init = function() {
// Instantiate a Mocha instance.
var mocha = new plugins.mocha();
var testDir = 'some/dir/test';
// Add each .js file to the mocha instance
plugins.fs.readdirSync(testDir).filter(function(file){
// Only keep the .js files
return file.substr(-3) === '.js';
}).forEach(function(file){
mocha.addFile(
plugins.path.join(testDir, file)
);
});
// Run the tests.
mocha.run(function(failures){
process.on('exit', function () {
process.exit(failures);
});
});
}
}