diff --git a/__tests__/cmds/__snapshots__/login.test.js.snap b/__tests__/cmds/__snapshots__/login.test.js.snap deleted file mode 100644 index e39ee3c50..000000000 --- a/__tests__/cmds/__snapshots__/login.test.js.snap +++ /dev/null @@ -1,5 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`rdme login should post to /login on the API 1`] = `"Successfully logged in as user@example.com to the subdomain project."`; - -exports[`rdme login should send 2fa token if provided 1`] = `"Successfully logged in as user@example.com to the subdomain project."`; diff --git a/__tests__/cmds/__snapshots__/versions.test.js.snap b/__tests__/cmds/__snapshots__/versions.test.js.snap deleted file mode 100644 index afb45d79e..000000000 --- a/__tests__/cmds/__snapshots__/versions.test.js.snap +++ /dev/null @@ -1,23 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`rdme versions* rdme versions should get a specific version object if version flag provided 1`] = ` -"Version: 1.0.0 -Codename: None -Created on: 2019-06-17T22:39:56.462Z -Released on: undefined -┌───────────────┬───────────┬─────────┬───────────┐ -│ Is deprecated │ Is hidden │ Is beta │ Is stable │ -├───────────────┼───────────┼─────────┼───────────┤ -│ no │ no │ no │ yes │ -└───────────────┴───────────┴─────────┴───────────┘" -`; - -exports[`rdme versions* rdme versions should make a request to get a list of existing versions 1`] = ` -"┌─────────┬──────────┬───────────────┬───────────┬─────────┬───────────┬──────────────────────────┐ -│ Version │ Codename │ Is deprecated │ Is hidden │ Is beta │ Is stable │ Created on │ -├─────────┼──────────┼───────────────┼───────────┼─────────┼───────────┼──────────────────────────┤ -│ 1.0.0 │ None │ no │ no │ no │ yes │ 2019-06-17T22:39:56.462Z │ -├─────────┼──────────┼───────────────┼───────────┼─────────┼───────────┼──────────────────────────┤ -│ 2.0.0 │ None │ no │ no │ no │ yes │ 2019-06-17T22:39:56.462Z │ -└─────────┴──────────┴───────────────┴───────────┴─────────┴───────────┴──────────────────────────┘" -`; diff --git a/__tests__/cmds/login.test.js b/__tests__/cmds/login.test.js index 8a66da270..2274787bc 100644 --- a/__tests__/cmds/login.test.js +++ b/__tests__/cmds/login.test.js @@ -34,7 +34,10 @@ 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(); + const output = await cmd.run({ email, password, project }); + expect(output).toContain('user@example.com'); + expect(output).toContain('subdomain'); + mock.done(); expect(configStore.get('apiKey')).toBe(apiKey); @@ -78,7 +81,10 @@ describe('rdme login', () => { .post('/api/v1/login', { email, password, project, token }) .reply(200, { apiKey: '123' }); - await expect(cmd.run({ email, password, project, token })).resolves.toMatchSnapshot(); + const output = await cmd.run({ email, password, project, token }); + expect(output).toContain('user@example.com'); + expect(output).toContain('subdomain'); + mock.done(); }); diff --git a/__tests__/cmds/versions.test.js b/__tests__/cmds/versions.test.js index edd32bafa..f6100855f 100644 --- a/__tests__/cmds/versions.test.js +++ b/__tests__/cmds/versions.test.js @@ -54,7 +54,9 @@ describe('rdme versions*', () => { .basicAuth({ user: key }) .reply(200, [versionPayload, version2Payload]); - await expect(versions.run({ key })).resolves.toMatchSnapshot(); + const table = await versions.run({ key }); + expect(table).toContain(version); + expect(table).toContain(version2); mockRequest.done(); }); @@ -75,7 +77,9 @@ describe('rdme versions*', () => { .basicAuth({ user: key }) .reply(200, versionPayload); - await expect(versions.run({ key, version })).resolves.toMatchSnapshot(); + const table = await versions.run({ key, version }); + expect(table).toContain(version); + expect(table).not.toContain(version2); mockRequest.done(); }); diff --git a/__tests__/set-node-env.js b/__tests__/set-node-env.js index aa0d807e1..4bee43cae 100644 --- a/__tests__/set-node-env.js +++ b/__tests__/set-node-env.js @@ -1,4 +1 @@ -// Chalk has trouble with Jest sometimes in test snapshots so we're disabling colorization here for all tests. -process.env.FORCE_COLOR = 0; - process.env.NODE_ENV = 'testing';