Skip to content

Commit

Permalink
Add test for GitHub enterprise host web release url
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Jan 9, 2022
1 parent a467b5f commit e4718b0
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion test/github.js
Expand Up @@ -359,7 +359,6 @@ test('should skip checks', async t => {

test('should generate GitHub web release url', async t => {
const options = {
git,
github: {
pushRepo,
release: true,
Expand All @@ -382,3 +381,29 @@ test('should generate GitHub web release url', async t => {
);
exec.restore();
});

test('should generate GitHub web release url for enterprise host', async t => {
const options = {
github: {
pushRepo: 'git://my-custom-host.org:user/repo',
release: true,
web: true,
host: 'my-custom-host.org',
releaseName: 'The Launch',
releaseNotes: 'echo It happened'
}
};
const github = factory(GitHub, { options });
const exec = sinon.stub(github.shell, 'exec').callThrough();
exec.withArgs('git describe --tags --match=* --abbrev=0').resolves('2.0.1');

await runTasks(github);

const { isReleased, releaseUrl } = github.getContext();
t.true(isReleased);
t.is(
releaseUrl,
'https://my-custom-host.org/user/repo/releases/new?tag=2.0.2&title=The+Launch&body=It+happened&prerelease=false'
);
exec.restore();
});

0 comments on commit e4718b0

Please sign in to comment.