Skip to content

Commit

Permalink
Fixed unit tests after ESNext migration.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmester committed Jul 30, 2020
1 parent f9ba394 commit c785509
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,29 @@ gulp.task("build", gulp.series("clean", gulp.parallel(
"build-node",
)));

gulp.task("clean-tests", function (cb) {
del(["./obj/test/node/*.js", "./obj/test/node/*.map"], cb);
});

gulp.task("build-tests-js", function () {
return gulp.src("./test/node/*.js", { base: "./" })
.pipe(sourcemaps.init())
.pipe(rollup({
external: [ "canvas-renderer", "fs", "tap" ],
plugins: [ commonjs() ],
output: { format: "cjs" },
}))
.pipe(sourcemaps.write("./"))
.pipe(gulp.dest("./obj"))
});

gulp.task("copy-tests-assets", function () {
return gulp.src("./test/node/expected/*")
.pipe(gulp.dest("./obj/test/node/expected/"))
});

gulp.task("build-tests", gulp.series("clean-tests", "build-tests-js", "copy-tests-assets"));

gulp.task("preparerelease", function () {
return gulp.src(["./LICENSE", "./README.md"])
.pipe(replaceVariables())
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"build": "gulp build",
"release": "gulp release",
"test": "npm run test:unit && npm run test:types",
"test:unit": "tap test/node/*.js",
"test:unit": "gulp build-tests && tap obj/test/node/*.js",
"test:types": "tsc -p ./types/test/tsconfig.json"
},
"files": [
Expand Down

0 comments on commit c785509

Please sign in to comment.