Skip to content

Commit

Permalink
Completed swagger file testing
Browse files Browse the repository at this point in the history
  • Loading branch information
gratcliff committed Jul 15, 2019
1 parent 5df0bb8 commit ce79af3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion test/swagger.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ describe('swagger command', () => {
.reply(200, [{ version: '1.0.1' }])
.post('/api/v1/version')
.basicAuth({ user: key })
.reply(200, { version: '1.0.1' });
.reply(200, { version: '1.0.1' })
.post('/api/v1/api-specification', body => body.match('form-data; name="spec"'))
.basicAuth({ user: key })
.reply(201, { id: 1 });

return swagger(['./test/fixtures/swagger.json'], { key, version }).then(() => mock.done());
});
Expand Down
2 changes: 1 addition & 1 deletion test/versions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ describe('Versions CLI Commands', () => {
const mockRequest = nock(config.host)
.delete(`/api/v1/version/${version}`)
.basicAuth({ user: key })
.reply(201);
.reply(200);

await deleteVersion([], { key, version });
mockRequest.done();
Expand Down

0 comments on commit ce79af3

Please sign in to comment.