Skip to content

Commit

Permalink
test: Update test to work with [email protected]
Browse files Browse the repository at this point in the history
Do not expect the filePath to be sent. Ref octokit/octokit.js@3c2e465
  • Loading branch information
pvdlg committed Nov 22, 2017
1 parent 3e161cb commit 336ba0a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 34 deletions.
24 changes: 8 additions & 16 deletions test/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,12 @@ test.serial('Publish a release with an array of assets', async t => {
.reply({});

const githubUpload = upload({githubToken})
.post(
`/repos/${owner}/${repo}/releases/${releaseId}/assets?filePath=${escape(
'test/fixtures/upload.txt'
)}&name=${escape('upload.txt')}`
)
.post(`/repos/${owner}/${repo}/releases/${releaseId}/assets?name=${escape('upload.txt')}`)
.reply(200, {browser_download_url: assetUrl})
.post(
`/repos/${owner}/${repo}/releases/${releaseId}/assets?filePath=${escape(
'test/fixtures/upload_other.txt'
)}&name=${escape('other_file.txt')}&label=${escape('Other File')}`
`/repos/${owner}/${repo}/releases/${releaseId}/assets?name=${escape('other_file.txt')}&label=${escape(
'Other File'
)}`
)
.reply(200, {browser_download_url: otherAssetUrl});

Expand Down Expand Up @@ -180,16 +176,12 @@ test.serial('Verify Github auth and release', async t => {
.reply({});

const githubUpload = upload({githubToken: process.env.GH_TOKEN})
.post(
`/repos/${owner}/${repo}/releases/${releaseId}/assets?filePath=${escape(
'test/fixtures/upload.txt'
)}&name=${escape('upload.txt')}`
)
.post(`/repos/${owner}/${repo}/releases/${releaseId}/assets?name=${escape('upload.txt')}`)
.reply(200, {browser_download_url: assetUrl})
.post(
`/repos/${owner}/${repo}/releases/${releaseId}/assets?filePath=${escape(
'test/fixtures/upload_other.txt'
)}&name=${escape('other_file.txt')}&label=${escape('Other File')}`
`/repos/${owner}/${repo}/releases/${releaseId}/assets?name=${escape('other_file.txt')}&label=${escape(
'Other File'
)}`
)
.reply(200, {browser_download_url: otherAssetUrl});

Expand Down
24 changes: 6 additions & 18 deletions test/publish.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,7 @@ test.serial('Publish a release with one asset', async t => {
.reply({});

const githubUpload = upload({githubUrl: process.env.GH_URL, githubToken: process.env.GH_TOKEN})
.post(
`/repos/${owner}/${repo}/releases/${releaseId}/assets?filePath=${escape(
'test/fixtures/upload.txt'
)}&name=${escape('upload.txt')}`
)
.post(`/repos/${owner}/${repo}/releases/${releaseId}/assets?name=${escape('upload.txt')}`)
.reply(200, {browser_download_url: assetUrl});

await publish(pluginConfig, options, pkg, nextRelease, t.context.logger);
Expand Down Expand Up @@ -133,11 +129,7 @@ test.serial('Publish a release with one asset and custom github url', async t =>
.reply({});

const githubUpload = upload({githubToken: process.env.GITHUB_TOKEN, githubUrl: process.env.GITHUB_URL})
.post(
`/repos/${owner}/${repo}/releases/${releaseId}/assets?filePath=${escape(
'test/fixtures/upload.txt'
)}&name=${escape('upload.txt')}`
)
.post(`/repos/${owner}/${repo}/releases/${releaseId}/assets?name=${escape('upload.txt')}`)
.reply(200, {browser_download_url: assetUrl});

await publish(pluginConfig, options, pkg, nextRelease, t.context.logger);
Expand Down Expand Up @@ -179,16 +171,12 @@ test.serial('Publish a release with an array of assets', async t => {
.reply({});

const githubUpload = upload({githubToken})
.post(
`/repos/${owner}/${repo}/releases/${releaseId}/assets?filePath=${escape(
'test/fixtures/upload.txt'
)}&name=${escape('upload.txt')}`
)
.post(`/repos/${owner}/${repo}/releases/${releaseId}/assets?name=${escape('upload.txt')}`)
.reply(200, {browser_download_url: assetUrl})
.post(
`/repos/${owner}/${repo}/releases/${releaseId}/assets?filePath=${escape(
'test/fixtures/upload_other.txt'
)}&name=${escape('other_file.txt')}&label=${escape('Other File')}`
`/repos/${owner}/${repo}/releases/${releaseId}/assets?name=${escape('other_file.txt')}&label=${escape(
'Other File'
)}`
)
.reply(200, {browser_download_url: otherAssetUrl});

Expand Down

0 comments on commit 336ba0a

Please sign in to comment.