Skip to content

Commit

Permalink
Remove duplicate test and wrap up proxy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Apr 14, 2022
1 parent 1fe1afa commit f1e8843
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 31 deletions.
2 changes: 1 addition & 1 deletion lib/plugin/github/GitHub.js
Expand Up @@ -7,11 +7,11 @@ const _ = require('lodash');
const retry = require('async-retry');
const newGithubReleaseUrl = require('new-github-release-url');
const open = require('open');
const ProxyAgent = require('proxy-agent');
const pkg = require('../../../package.json');
const { format, parseVersion, e } = require('../../util');
const Release = require('../GitRelease');
const prompts = require('./prompts');
const ProxyAgent = require('proxy-agent');

const docs = 'https://git.io/release-it-github';

Expand Down
31 changes: 1 addition & 30 deletions test/github.js
Expand Up @@ -236,6 +236,7 @@ test('should release to alternative host and proxy', async t => {
const { isReleased, releaseUrl } = github.getContext();
t.true(isReleased);
t.is(releaseUrl, `https://custom.example.org/user/repo/releases/tag/1.0.1`);
t.is(github.options.proxy, 'http://proxy:8080');
exec.restore();
});

Expand Down Expand Up @@ -407,33 +408,3 @@ test('should generate GitHub web release url for enterprise host', async t => {
);
exec.restore();
});

test('should generate Github web release when proxy is set', async t => {
const options = {
git,
github: {
pushRepo: 'git://custom.example.org:user/repo',
release: true,
web: true,
host: 'custom.example.org',
releaseName: 'The Launch',
releaseNotes: 'echo It happened',
proxy: 'http://proxy.example.org:8181'
}
};

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://custom.example.org/user/repo/releases/new?tag=2.0.2&title=The+Launch&body=It+happened&prerelease=false'
);
t.is(github.options.proxy, 'http://proxy.example.org:8181');
exec.restore();
});

0 comments on commit f1e8843

Please sign in to comment.