This repository has been archived by the owner on Jun 18, 2019. It is now read-only.
/
test.js
42 lines (34 loc) · 1.57 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//******************************************************************************
//* test.js
//*
//* Defines a custom gulp task for executing the unit tests (with mocha) and
//* also reporting on code coverage (with istanbul).
//******************************************************************************
"use strict";
//******************************************************************************
//* DEPENDENCIES
//******************************************************************************
var gulp = require("gulp"),
mocha = require("gulp-mocha"),
istanbul = require("gulp-istanbul"),
tsc = require("gulp-typescript");
//******************************************************************************
//* TEST
//******************************************************************************
gulp.task("build-tests", ["clean"], function() {
var src = global.TSWorkspace.Tests.slice(0);
src.push(global.TSTypings.Main);
return gulp.src(src)
.pipe(tsc(global.tsProject))
.pipe(gulp.dest(global.TSCompiledOutput.TestRootFolder));
});
gulp.task("test", ["build", "build-tests", "istanbul:hook"], function() {
return gulp.src(global.TSCompiledOutput.JSTestFiles)
.pipe(mocha({ ui: 'bdd', reporter: 'dot', timeout: 10000 }))
.pipe(istanbul.writeReports());
});
gulp.task("subscriptions-test", ["build", "build-tests", "istanbul:hook"], function() {
return gulp.src('./build/tests/sharepoint/rest/subscriptions.test.js')
.pipe(mocha({ ui: 'bdd', reporter: 'dot', timeout: 10000 }))
.pipe(istanbul.writeReports());
});