integrate mocha

This commit is contained in:
Philipp Kunz 2016-02-01 03:10:58 +01:00
parent 6a884cda78
commit 774269da57
7 changed files with 36 additions and 169425 deletions

View File

@ -1,31 +1,29 @@
/// <reference path="./typings/main.d.ts" />
console.log("**** starting test ****");
var plugins = {
beautylog: require("beautylog"),
gulp: require("gulp"),
gulpBrowser: require("../index.js"),
gulpCallFunction: require("gulp-callfunction")
};
var pipeWorked = function () {
plugins.beautylog.info("Pipe didn't break! Ready for Primetime!");
};
plugins.beautylog.log('Now trying to browserify a testfile...');
plugins.gulp.task('gulpBrowserTest', function (cb) {
var stream = plugins.gulp.src('./testassets/browserifyGulpTest.js')
.pipe(plugins.gulpBrowser.browserify())
.pipe(plugins.gulp.dest("./testassets/result/"))
.pipe(plugins.gulpCallFunction(pipeWorked));
return stream;
describe("gulpBrowser", function () {
describe(".browserify", function () {
it("should run through smoothly", function (done) {
this.timeout(15000);
plugins.gulp.task('gulpBrowserNormal', function (cb) {
var stream = plugins.gulp.src('./test/browserifyGulpTest.js')
.pipe(plugins.gulpBrowser.browserify())
.pipe(plugins.gulp.dest("./test/result/"))
.pipe(plugins.gulpCallFunction(done));
return stream;
});
plugins.gulp.start.apply(plugins.gulp, ['gulpBrowserNormal']);
});
});
});
plugins.gulp.task('gulpBrowserTestError', function (cb) {
plugins.beautylog.info("Expecting an error:");
var stream = plugins.gulp.src('./testassets/browserifyGulpTestError.js')
var stream = plugins.gulp.src('./test/browserifyGulpTestError.js')
.pipe(plugins.gulpBrowser.browserify())
.pipe(plugins.gulp.dest("./testassets/result/"))
.pipe(plugins.gulpCallFunction(pipeWorked));
.pipe(plugins.gulp.dest("./test/result/"));
return stream;
});
plugins.gulp.task("default", ['gulpBrowserTest', 'gulpBrowserTestError'], function () {
plugins.beautylog.success("Test passed!");
});
plugins.gulp.start.apply(plugins.gulp, ['default']);

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
var myError = require("my-error");

View File

@ -1,5 +1,4 @@
/// <reference path="./typings/main.d.ts" />
console.log("**** starting test ****");
var plugins = {
beautylog: require("beautylog"),
gulp: require("gulp"),
@ -7,28 +6,26 @@ var plugins = {
gulpCallFunction: require("gulp-callfunction")
};
var pipeWorked = function() {
plugins.beautylog.info("Pipe didn't break! Ready for Primetime!");
};
plugins.beautylog.log('Now trying to browserify a testfile...');
plugins.gulp.task('gulpBrowserTest',function(cb) {
var stream = plugins.gulp.src('./testassets/browserifyGulpTest.js')
.pipe(plugins.gulpBrowser.browserify())
.pipe(plugins.gulp.dest("./testassets/result/"))
.pipe(plugins.gulpCallFunction(pipeWorked));
return stream;
describe("gulpBrowser",function(){
describe(".browserify",function(){
it("should run through smoothly",function(done){
this.timeout(15000);
plugins.gulp.task('gulpBrowserNormal',function(cb) {
var stream = plugins.gulp.src('./test/browserifyGulpTest.js')
.pipe(plugins.gulpBrowser.browserify())
.pipe(plugins.gulp.dest("./test/result/"))
.pipe(plugins.gulpCallFunction(done));
return stream;
});
plugins.gulp.start.apply(plugins.gulp, ['gulpBrowserNormal']);
});
});
});
plugins.gulp.task('gulpBrowserTestError',function(cb) {
plugins.beautylog.info("Expecting an error:");
var stream = plugins.gulp.src('./testassets/browserifyGulpTestError.js')
var stream = plugins.gulp.src('./test/browserifyGulpTestError.js')
.pipe(plugins.gulpBrowser.browserify())
.pipe(plugins.gulp.dest("./testassets/result/"))
.pipe(plugins.gulpCallFunction(pipeWorked));
.pipe(plugins.gulp.dest("./test/result/"))
return stream;
});
plugins.gulp.task("default",['gulpBrowserTest','gulpBrowserTestError'],function(){
plugins.beautylog.success("Test passed!");
});
plugins.gulp.start.apply(plugins.gulp, ['default']);

View File

@ -1,6 +1,7 @@
{
"ambientDependencies": {
"node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#3191f6e0088eee07c4d8fd24e4d27a40a60d9eb9",
"browserify": "github:DefinitelyTyped/DefinitelyTyped/browserify/browserify.d.ts#3191f6e0088eee07c4d8fd24e4d27a40a60d9eb9"
"browserify": "github:DefinitelyTyped/DefinitelyTyped/browserify/browserify.d.ts#3191f6e0088eee07c4d8fd24e4d27a40a60d9eb9",
"mocha": "github:Bartvds/tsd-deftools/typings/DefinitelyTyped/mocha/mocha.d.ts",
"node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#3191f6e0088eee07c4d8fd24e4d27a40a60d9eb9"
}
}