-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathscripts.js
More file actions
44 lines (41 loc) · 1.08 KB
/
Copy pathscripts.js
File metadata and controls
44 lines (41 loc) · 1.08 KB
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
43
44
const test = require('ava')
const { macro } = require('./_helpers')
const fixture = {
test: 'node test.js',
multiply: '2 * 3', // between p(ostinstall) and install
watch: 'watch things',
prewatch: 'echo "about to watch"',
postinstall: 'echo "Installed"',
start: 'node server.js',
posttest: 'abc',
pretest: 'xyz',
postprettier: 'echo "so pretty"',
'// preprettier comment': '',
preprettier: 'echo "not pretty"',
prettier: 'prettier -l "**/*.js"',
prepare: 'npm run build',
'pre-fetch-info': 'foo',
}
const expect = {
postinstall: 'echo "Installed"',
multiply: '2 * 3',
'pre-fetch-info': 'foo',
prepare: 'npm run build',
'// preprettier comment': '',
preprettier: 'echo "not pretty"',
prettier: 'prettier -l "**/*.js"',
postprettier: 'echo "so pretty"',
start: 'node server.js',
pretest: 'xyz',
test: 'node test.js',
posttest: 'abc',
prewatch: 'echo "about to watch"',
watch: 'watch things',
}
for (const field of ['scripts', 'betterScripts']) {
test(field, macro.sortObject, {
path: field,
value: fixture,
expect: expect,
})
}