-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: add version selection to all relevant commands * fix: add version selection for version commands * test: update version tests * refactor: rename from swagger to project * fix: convert all react-promise-native to node-fetch * fix: fixed transition to node-fetch for versions commands * refactor: fix duplicate code * fix: revert for failing tests * fix: delete swagger.json * fix: delete applytoreadme.md * fix: uninstall request and request-promise-native' * chore: changing some test keys that looks real Co-authored-by: Jon Ursenbach <[email protected]>
- Loading branch information
1 parent
31cc6f2
commit 74bad7d
Showing
15 changed files
with
317 additions
and
719 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ const promptHandler = require('../../src/lib/prompts'); | |
const swagger = require('../../src/cmds/swagger'); | ||
const openapi = require('../../src/cmds/openapi'); | ||
|
||
const key = 'Xmw4bGctRVIQz7R7dQXqH9nQe5d0SPQs'; | ||
const key = 'API_KEY'; | ||
const version = '1.0.0'; | ||
|
||
jest.mock('../../src/lib/prompts'); | ||
|
@@ -87,9 +87,14 @@ describe('rdme openapi', () => { | |
help: 'If you need help, email [email protected] and mention log "fake-metrics-uuid".', | ||
}); | ||
|
||
return expect(openapi.run({ spec: './__tests__/__fixtures__/swagger.json', key, version })) | ||
.rejects.toThrow('The version you specified') | ||
.then(() => mock.done()); | ||
return openapi.run({ spec: './__tests__/__fixtures__/swagger.json', key, version }).then(() => { | ||
expect(console.log).toHaveBeenCalledTimes(1); | ||
|
||
const output = getCommandOutput(); | ||
expect(output).toMatch(/The version you specified/); | ||
|
||
mock.done(); | ||
}); | ||
}); | ||
|
||
it('should POST to the swagger api if no id provided', () => { | ||
|
@@ -135,9 +140,14 @@ describe('rdme openapi', () => { | |
help: 'If you need help, email [email protected] and mention log "fake-metrics-uuid".', | ||
}); | ||
|
||
return expect(openapi.run({ spec: './__tests__/__fixtures__/invalid-swagger.json', key, version })) | ||
.rejects.toThrow('README VALIDATION ERROR "x-samples-languages" must be of type "Array"') | ||
.then(() => mock.done()); | ||
return openapi.run({ spec: './__tests__/__fixtures__/invalid-swagger.json', key, version }).then(() => { | ||
expect(console.log).toHaveBeenCalledTimes(1); | ||
|
||
const output = getCommandOutput(); | ||
expect(output).toMatch(/Unknown error \(README VALIDATION ERROR "x-samples-languages" /); | ||
|
||
mock.done(); | ||
}); | ||
}); | ||
|
||
it.todo('should return a 404 if version flag not found'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.