-
Notifications
You must be signed in to change notification settings - Fork 0
/
.madrun.js
29 lines (23 loc) · 1.04 KB
/
.madrun.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
import {
run,
cutEnv,
} from 'madrun';
const NODE_OPTIONS = `'--no-warnings --loader mock-import'`;
const testEnv = {
NODE_OPTIONS,
};
export default {
'test': () => [testEnv, `tape 'test/**/*.js' 'lib/**/*.spec.js'`],
'debug': async () => [testEnv, `node --inspect-brk --inspect=0.0.0.0 ${await cutEnv('coverage')}`],
'coverage': async () => [testEnv, `node_modules/.bin/c8 --exclude="lib/**/{fixture,*.spec.js}" ${await cutEnv('test')}`],
'lint': () => 'putout .',
'fresh:lint': () => run('lint', '--fresh'),
'lint:fresh': () => run('lint', '--fresh'),
'fix:lint': () => run('lint', '--fix'),
'report': () => 'c8 report --reporter=lcov',
'watcher': () => 'nodemon -w test -w lib --exec',
'watch:test': async () => await run('watcher', `"${await cutEnv('test')}"`, testEnv),
'watch:lint': () => run('watcher', '\'npm run lint\''),
'watch:tape': () => 'nodemon -w test -w lib --exec tape',
'watch:coverage': async () => await run('watcher', await cutEnv('coverage'), testEnv),
};