-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from embroider-build/publish-branch
add --publish-branch if passed to release-plan publish
- Loading branch information
Showing
3 changed files
with
129 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { describe, it, expect } from 'vitest'; | ||
import { npmPublish, IssueReporter } from './publish.js'; | ||
import { Solution } from './plan.js'; | ||
|
||
// we aren't currently using this so we can just ignore for now | ||
const reporter = new IssueReporter(); | ||
|
||
describe('publish', function () { | ||
describe('npmPublish', function () { | ||
it('adds the correct args with no options', async function () { | ||
const thingy = await npmPublish( | ||
new Map([['thingy', { oldVersion: '3' }]]) as Solution, | ||
reporter, | ||
{}, | ||
'face', | ||
); | ||
|
||
expect(thingy).toMatchInlineSnapshot(` | ||
{ | ||
"args": [ | ||
"publish", | ||
"--access=public", | ||
], | ||
"released": Map {}, | ||
} | ||
`); | ||
}); | ||
|
||
it('adds otp if passed by options', async function () { | ||
const thingy = await npmPublish( | ||
new Map([['thingy', { oldVersion: '3' }]]) as Solution, | ||
reporter, | ||
{ | ||
otp: '12345', | ||
}, | ||
'face', | ||
); | ||
|
||
expect(thingy).toMatchInlineSnapshot(` | ||
{ | ||
"args": [ | ||
"publish", | ||
"--access=public", | ||
"--otp=12345", | ||
], | ||
"released": Map {}, | ||
} | ||
`); | ||
}); | ||
|
||
it('adds publish-branch if passed by options', async function () { | ||
const thingy = await npmPublish( | ||
new Map([['thingy', { oldVersion: '3' }]]) as Solution, | ||
reporter, | ||
{ | ||
publishBranch: 'best-branch', | ||
}, | ||
'face', | ||
); | ||
|
||
expect(thingy).toMatchInlineSnapshot(` | ||
{ | ||
"args": [ | ||
"publish", | ||
"--access=public", | ||
"--publish-branch=best-branch", | ||
], | ||
"released": Map {}, | ||
} | ||
`); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters