-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathrelease.js
57 lines (46 loc) · 1.47 KB
/
release.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
const t = require('tap')
const { join } = require('path')
const setup = require('../setup.js')
t.test('no workspace flags in commands', async t => {
const s = await setup(t, {
package: {
templateOSS: {
publish: true,
},
},
})
await s.apply()
const ciRelease = await s.readFile(join('.github', 'workflows', 'ci-release.yml'))
t.match(ciRelease, '--ignore-scripts\n')
t.notMatch(ciRelease, '--ignore-scripts --workspaces --include-workspace-root --if-present\n')
const release = await s.readFile(join('.github', 'workflows', 'release.yml'))
t.match(release, '--publish')
t.match(release, '--backport=""')
})
t.test('uses workspace flags in commands', async t => {
const s = await setup(t, {
workspaces: {
a: 'a',
},
})
await s.apply()
const ciRelease = await s.readFile(join('.github', 'workflows', 'ci-release.yml'))
t.notMatch(ciRelease, '--ignore-scripts\n')
t.match(ciRelease, '--ignore-scripts --workspaces --include-workspace-root --if-present\n')
})
t.test('backport', async t => {
const s = await setup(t, {
package: {
templateOSS: {
backport: 8,
publish: true,
},
},
})
await s.apply()
const ciRelease = await s.readFile(join('.github', 'workflows', 'ci-release.yml'))
t.match(ciRelease, 'default: release/v8\n')
const release = await s.readFile(join('.github', 'workflows', 'release.yml'))
t.match(release, '--publish')
t.match(release, '--backport="8"')
})