-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.mjs
29 lines (25 loc) · 1 KB
/
gulpfile.mjs
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
import { clean, lint, makeBrowserSpecRunner, makeLib } from './dev/impl.mjs';
import { fork } from 'child_process';
import gulp from 'gulp';
import { createRequire } from 'module';
const { parallel, series } = gulp;
export function test(callback)
{
const { resolve } = createRequire(import.meta.url);
const nycPath = resolve('nyc/bin/nyc');
const mochaPath = resolve('mocha/bin/mocha');
const forkArgs =
[
'--include=src',
'--reporter=html',
'--reporter=text-summary',
mochaPath,
'--check-leaks',
'--require=ts-node/register',
'test/spec/**/*.spec.ts',
];
const childProcess = fork(nycPath, forkArgs);
childProcess.on('exit', code => callback(code && 'Test failed'));
}
export { clean, lint, makeBrowserSpecRunner, makeLib };
export default series(parallel(clean, lint), test, parallel(makeLib, makeBrowserSpecRunner));