-
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.
refactor: commands into command classes (#424)
* fix: quirks with version commands not always handling errors properly * fix: use the right accessor for getting config data * refactor: commands into command classes * fix: typos * fix: we know the name of the login command * fix: reverting an unnecessary change * fix: pr feedback * fix: bring back snapshot * fix: pulling some snapshots that have color in them as they're causing flaky tests * test: tweaks * fix: removing a dupe color config
- Loading branch information
Showing
28 changed files
with
959 additions
and
907 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
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
coverage | ||
node_modules/ | ||
coverage/ | ||
swagger.json |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
const nock = require('nock'); | ||
const config = require('config'); | ||
const configStore = require('../../src/lib/configstore'); | ||
const cmd = require('../../src/cmds/login'); | ||
const Command = require('../../src/cmds/login'); | ||
const APIError = require('../../src/lib/apiError'); | ||
|
||
const cmd = new Command(); | ||
|
||
const email = '[email protected]'; | ||
const password = '123456'; | ||
const project = 'subdomain'; | ||
|
@@ -33,6 +35,7 @@ describe('rdme login', () => { | |
const mock = nock(config.get('host')).post('/api/v1/login', { email, password, project }).reply(200, { apiKey }); | ||
|
||
await expect(cmd.run({ email, password, project })).resolves.toMatchSnapshot(); | ||
|
||
mock.done(); | ||
|
||
expect(configStore.get('apiKey')).toBe(apiKey); | ||
|
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
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
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
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
// Chalk has trouble with Jest sometimes in test snapshots so we're disabling colorization here for all tests. | ||
// The `chalk` and `colors` libraries have trouble with Jest sometimes in test snapshots so we're disabling | ||
// colorization here for all tests. | ||
// https://github.com/chalk/supports-color/issues/106 | ||
process.env.FORCE_COLOR = 0; | ||
|
||
process.env.NODE_ENV = 'testing'; |
Oops, something went wrong.