Skip to content

Commit 8a83c82

Browse files
committed
Got istanbul working
1 parent 6345f5a commit 8a83c82

File tree

5 files changed

+741
-682
lines changed

5 files changed

+741
-682
lines changed

coverage-remapped/coverage-final.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

gulpfile.ts

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ import * as glob from "glob";
44
import * as gulp from "gulp";
55
import * as concat from "gulp-concat";
66
import * as istanbul from "gulp-istanbul";
7+
import * as shell from "gulp-shell";
78
import tslint from "gulp-tslint";
89
import * as ts from "gulp-typescript";
910
import { TapBark } from "tap-bark";
1011

12+
import * as remapIstanbul from "remap-istanbul/lib/gulpRemapIstanbul";
13+
1114
import {parseCommandLine} from "./src/CommandLineParser";
1215
import {compile, compileFilesWithOptions} from "./src/Compiler";
1316

@@ -50,33 +53,33 @@ gulp.task(
5053

5154
gulp.task("clean-test", () => del("./test/**/*.spec.js"));
5255

53-
gulp.task("build-test", () => {
54-
const tsProject = ts.createProject("./test/tsconfig.json");
55-
return tsProject.src().pipe(tsProject()).js.pipe(gulp.dest("./test"));
56-
});
56+
gulp.task("build-test", shell.task("tsc -p ./test", {cwd: __dirname}));
5757

5858
gulp.task("pre-test", () =>
59-
gulp.src(["src/**/*.js"])
59+
gulp.src(["./src/**/*.js"])
6060
.pipe(istanbul())
6161
.pipe(istanbul.hookRequire())
6262
);
6363

64-
gulp.task("unit-tests", (done: () => any) => {
64+
gulp.task("unit-tests", done => {
6565
const testSet = TestSet.create();
6666

6767
testSet.addTestsFromFiles("./test/**/*.spec.js");
6868

6969
const testRunner = new TestRunner();
7070

71-
testRunner.outputStream
72-
.pipe(TapBark.create().getPipeable())
73-
.pipe(process.stdout);
71+
// testRunner.outputStream
72+
// .pipe(TapBark.create().getPipeable())
73+
// .pipe(process.stdout);
7474

7575
testRunner.run(testSet)
7676
.then(() => {
77-
istanbul.writeReports();
78-
done();
79-
});
77+
console.log("sdasddsadasdas");
78+
gulp.src("./coverage/coverage-final.json")
79+
.pipe(istanbul.writeReports({reporters: ["lcov", "json", "text"]}))
80+
.pipe(remapIstanbul())
81+
.pipe(gulp.dest("coverage-remapped")).on("end", done);
82+
}).catch(error => console.log(error));
8083
});
8184

8285
gulp.task("test", gulp.series(/*"tslint",*/ "clean-test", "build-test", "lualib", "pre-test", "unit-tests", "clean-test"));

0 commit comments

Comments
 (0)