Skip to content

Commit

Permalink
Fix swagger upload now that there's a command before the filename
Browse files Browse the repository at this point in the history
  • Loading branch information
Dom Harrington committed Mar 8, 2018
1 parent 54890b9 commit 43ff7f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/swagger.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ exports.run = function(config, info, cb) {

const options = {
formData: {
swagger: fs.createReadStream(path.resolve(process.cwd(), info.args[0])),
swagger: fs.createReadStream(path.resolve(process.cwd(), info.args[1])),
},
auth: { user: apiKey },
};
Expand Down
4 changes: 2 additions & 2 deletions test/swagger.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('swagger action', () => {
return body.match('form-data; name=\"swagger\"');
}).basicAuth({ user: apiKey }).reply(201);

swagger.run(config, { args: ['./test/fixtures/json/swagger.json'], opts: { token: apiKey } }, (err) => {
swagger.run(config, { args: ['swagger', './test/fixtures/json/swagger.json'], opts: { token: apiKey } }, (err) => {
if (err) return done(err);
mock.done();

Expand All @@ -28,7 +28,7 @@ describe('swagger action', () => {
return body.match('form-data; name=\"swagger\"');
}).basicAuth({ user: apiKey }).reply(201);

swagger.run(config, { args: ['./test/fixtures/json/swagger.json'], opts: { token: `${apiKey}-${id}` } }, (err) => {
swagger.run(config, { args: ['swagger', './test/fixtures/json/swagger.json'], opts: { token: `${apiKey}-${id}` } }, (err) => {
if (err) return done(err);
mock.done();

Expand Down

0 comments on commit 43ff7f5

Please sign in to comment.