@@ -3,13 +3,22 @@ const { join } = require('path')
3
3
const setup = require ( '../setup.js' )
4
4
5
5
t . test ( 'no workspace flags in commands' , async ( t ) => {
6
- const s = await setup ( t )
6
+ const s = await setup ( t , {
7
+ package : {
8
+ templateOSS : {
9
+ publish : true ,
10
+ } ,
11
+ } ,
12
+ } )
7
13
await s . apply ( )
8
14
9
- const release = await s . readFile ( join ( '.github' , 'workflows' , 'ci-release.yml' ) )
15
+ const ciRelease = await s . readFile ( join ( '.github' , 'workflows' , 'ci-release.yml' ) )
16
+
17
+ t . match ( ciRelease , '--ignore-scripts\n' )
18
+ t . notMatch ( ciRelease , '--ignore-scripts -ws -iwr --if-present\n' )
10
19
11
- t . match ( release , '--ignore-scripts\n' )
12
- t . notMatch ( release , '--ignore-scripts -ws -iwr --if-present \n' )
20
+ const release = await s . readFile ( join ( '.github' , 'workflows' , 'release.yml' ) )
21
+ t . match ( release , 'npm publish --provenance --tag=latest \n' )
13
22
} )
14
23
15
24
t . test ( 'uses workspace flags in commands' , async ( t ) => {
@@ -20,8 +29,27 @@ t.test('uses workspace flags in commands', async (t) => {
20
29
} )
21
30
await s . apply ( )
22
31
23
- const release = await s . readFile ( join ( '.github' , 'workflows' , 'ci-release.yml' ) )
32
+ const ciRelease = await s . readFile ( join ( '.github' , 'workflows' , 'ci-release.yml' ) )
33
+
34
+ t . notMatch ( ciRelease , '--ignore-scripts\n' )
35
+ t . match ( ciRelease , '--ignore-scripts -ws -iwr --if-present\n' )
36
+ } )
37
+
38
+ t . test ( 'backport' , async ( t ) => {
39
+ const s = await setup ( t , {
40
+ package : {
41
+ templateOSS : {
42
+ backport : 8 ,
43
+ publish : true ,
44
+ } ,
45
+ } ,
46
+ } )
47
+ await s . apply ( )
48
+
49
+ const ciRelease = await s . readFile ( join ( '.github' , 'workflows' , 'ci-release.yml' ) )
50
+
51
+ t . match ( ciRelease , 'default: release/v8\n' )
24
52
25
- t . notMatch ( release , '--ignore-scripts\n' )
26
- t . match ( release , '--ignore-scripts -ws -iwr --if-present \n' )
53
+ const release = await s . readFile ( join ( '.github' , 'workflows' , 'release.yml' ) )
54
+ t . match ( release , 'npm publish --provenance --tag=next-8 \n' )
27
55
} )
0 commit comments