diff --git a/lib/plugin/github/GitHub.js b/lib/plugin/github/GitHub.js index 2b482d59..c34a0916 100644 --- a/lib/plugin/github/GitHub.js +++ b/lib/plugin/github/GitHub.js @@ -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'; diff --git a/test/github.js b/test/github.js index b05e6812..4c76c9c6 100644 --- a/test/github.js +++ b/test/github.js @@ -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(); }); @@ -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(); -});