@@ -12,6 +12,7 @@ const {
12
12
gitPush,
13
13
gitTag,
14
14
gitGetTags,
15
+ gitReleaseBranches,
15
16
} = require ( "../helpers/git" ) ;
16
17
17
18
// Clear mocks before tests.
@@ -25,6 +26,7 @@ describe("multiSemanticRelease()", () => {
25
26
test ( "Initial commit (changes in all packages)" , async ( ) => {
26
27
// Create Git repo with copy of Yarn workspaces fixture.
27
28
const cwd = gitInit ( ) ;
29
+ const branches = gitReleaseBranches ( ) ;
28
30
copyDirectory ( `test/fixtures/yarnWorkspaces/` , cwd ) ;
29
31
const sha = gitCommitAll ( cwd , "feat: Initial release" ) ;
30
32
const url = gitInitOrigin ( cwd ) ;
@@ -44,7 +46,7 @@ describe("multiSemanticRelease()", () => {
44
46
`packages/c/package.json` ,
45
47
`packages/d/package.json` ,
46
48
] ,
47
- { } ,
49
+ { branches } ,
48
50
{ cwd, stdout, stderr }
49
51
) ;
50
52
@@ -145,6 +147,7 @@ describe("multiSemanticRelease()", () => {
145
147
test ( "No changes in any packages" , async ( ) => {
146
148
// Create Git repo with copy of Yarn workspaces fixture.
147
149
const cwd = gitInit ( ) ;
150
+ const branches = gitReleaseBranches ( ) ;
148
151
copyDirectory ( `test/fixtures/yarnWorkspaces/` , cwd ) ;
149
152
const sha = gitCommitAll ( cwd , "feat: Initial release" ) ;
150
153
// Creating the four tags so there are no changes in any packages.
@@ -169,7 +172,7 @@ describe("multiSemanticRelease()", () => {
169
172
`packages/d/package.json` ,
170
173
`packages/b/package.json` ,
171
174
] ,
172
- { } ,
175
+ { branches } ,
173
176
{ cwd, stdout, stderr }
174
177
) ;
175
178
@@ -197,6 +200,7 @@ describe("multiSemanticRelease()", () => {
197
200
test ( "Changes in some packages" , async ( ) => {
198
201
// Create Git repo.
199
202
const cwd = gitInit ( ) ;
203
+ const branches = gitReleaseBranches ( ) ;
200
204
// Initial commit.
201
205
copyDirectory ( `test/fixtures/yarnWorkspaces/` , cwd ) ;
202
206
const sha1 = gitCommitAll ( cwd , "feat: Initial release" ) ;
@@ -224,7 +228,7 @@ describe("multiSemanticRelease()", () => {
224
228
`packages/b/package.json` ,
225
229
`packages/a/package.json` ,
226
230
] ,
227
- { } ,
231
+ { branches } ,
228
232
{ cwd, stdout, stderr }
229
233
) ;
230
234
@@ -332,6 +336,7 @@ describe("multiSemanticRelease()", () => {
332
336
test ( "Error if release's local deps have no version number" , async ( ) => {
333
337
// Create Git repo with copy of Yarn workspaces fixture.
334
338
const cwd = gitInit ( ) ;
339
+ const branches = gitReleaseBranches ( ) ;
335
340
copyDirectory ( `test/fixtures/yarnWorkspaces/` , cwd ) ;
336
341
gitAdd ( cwd , "packages/a/package.json" ) ;
337
342
const sha = gitCommit ( cwd , "feat: Commit first package only" ) ;
@@ -347,7 +352,7 @@ describe("multiSemanticRelease()", () => {
347
352
const multiSemanticRelease = require ( "../../" ) ;
348
353
const result = await multiSemanticRelease (
349
354
[ `packages/a/package.json` , `packages/c/package.json` ] ,
350
- { } ,
355
+ { branches } ,
351
356
{ cwd, stdout, stderr }
352
357
) ;
353
358
@@ -360,6 +365,7 @@ describe("multiSemanticRelease()", () => {
360
365
test ( "Configured plugins are called as normal" , async ( ) => {
361
366
// Create Git repo with copy of Yarn workspaces fixture.
362
367
const cwd = gitInit ( ) ;
368
+ const branches = gitReleaseBranches ( ) ;
363
369
copyDirectory ( `test/fixtures/yarnWorkspaces/` , cwd ) ;
364
370
const sha = gitCommitAll ( cwd , "feat: Initial release" ) ;
365
371
const url = gitInitOrigin ( cwd ) ;
@@ -388,6 +394,7 @@ describe("multiSemanticRelease()", () => {
388
394
// Override to add our own plugins.
389
395
plugins : [ "@semantic-release/release-notes-generator" , plugin ] ,
390
396
analyzeCommits : [ "@semantic-release/commit-analyzer" ] ,
397
+ branches,
391
398
} ,
392
399
{ cwd, stdout, stderr }
393
400
) ;
@@ -404,6 +411,7 @@ describe("multiSemanticRelease()", () => {
404
411
test ( "Deep errors (e.g. in plugins) bubble up and out" , async ( ) => {
405
412
// Create Git repo with copy of Yarn workspaces fixture.
406
413
const cwd = gitInit ( ) ;
414
+ const branches = gitReleaseBranches ( ) ;
407
415
copyDirectory ( `test/fixtures/yarnWorkspaces/` , cwd ) ;
408
416
const sha = gitCommitAll ( cwd , "feat: Initial release" ) ;
409
417
const url = gitInitOrigin ( cwd ) ;
@@ -430,6 +438,7 @@ describe("multiSemanticRelease()", () => {
430
438
} ,
431
439
} ,
432
440
] ,
441
+ branches,
433
442
} ,
434
443
{ cwd, stdout, stderr }
435
444
) ;
0 commit comments