add better tests and coverage
This commit is contained in:
6
test/test.d.ts
vendored
Normal file
6
test/test.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
/// <reference path="ts/typings/main.d.ts" />
|
||||
declare var gulp: any;
|
||||
declare var gulpFunction: any;
|
||||
declare var beautylog: any;
|
||||
declare var myFunction: () => void;
|
||||
declare var myFunction2: () => void;
|
29
test/test.js
29
test/test.js
@ -1,17 +1,30 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/// <reference path="typings/main.d.ts" />
|
||||
var gulp = require("gulp");
|
||||
var gulpFunction = require("../index.js");
|
||||
var beautylog = require("beautylog");
|
||||
var myFunction = function () {
|
||||
beautylog.log("Mocha Test successfull!");
|
||||
beautylog.log("Function executed");
|
||||
};
|
||||
var myFunction2 = function () {
|
||||
beautylog.log("Function2 executed");
|
||||
};
|
||||
describe("gulpFunction", function () {
|
||||
it("should run through smoothly", function () {
|
||||
gulp.task('default', function () {
|
||||
gulp.src('./test/test.md')
|
||||
.pipe(gulpFunction(myFunction, 'forEach'))
|
||||
.pipe(gulp.dest("./test/result/"));
|
||||
});
|
||||
gulp.start.apply(gulp, ['default']);
|
||||
it("should run through smoothly with " + "'forEach'".blue, function () {
|
||||
gulp.src('./test/*.md')
|
||||
.pipe(gulpFunction(myFunction, 'forEach'))
|
||||
.pipe(gulp.dest("./test/result/"));
|
||||
gulp.src('./test/*.md')
|
||||
.pipe(gulpFunction([myFunction, myFunction2], 'forEach'))
|
||||
.pipe(gulp.dest("./test/result/"));
|
||||
});
|
||||
it("should run through smoothly with " + "'atEnd'".blue, function () {
|
||||
gulp.src('./test/*.md')
|
||||
.pipe(gulpFunction(myFunction, 'atEnd'))
|
||||
.pipe(gulp.dest("./test/result/"));
|
||||
gulp.src('./test/*.md')
|
||||
.pipe(gulpFunction([myFunction, myFunction2], 'atEnd'))
|
||||
.pipe(gulp.dest("./test/result/"));
|
||||
});
|
||||
});
|
||||
|
2
test/test02.md
Normal file
2
test/test02.md
Normal file
@ -0,0 +1,2 @@
|
||||
# Test.md
|
||||
This is another test file for the test.js gulp pipeline
|
Reference in New Issue
Block a user