From aeb81702ab6b34e2f985f7228a6b110d99d7e387 Mon Sep 17 00:00:00 2001 From: kdnakt Date: Tue, 23 Jan 2018 08:08:22 +0900 Subject: [PATCH 01/12] add special option -- for npm update command --- packages/jest-cli/src/reporters/summary_reporter.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/jest-cli/src/reporters/summary_reporter.js b/packages/jest-cli/src/reporters/summary_reporter.js index 73df2aa69a45..2cadb37eed43 100644 --- a/packages/jest-cli/src/reporters/summary_reporter.js +++ b/packages/jest-cli/src/reporters/summary_reporter.js @@ -129,11 +129,10 @@ export default class SummaryReporter extends BaseReporter { let updateCommand; const event = process.env.npm_lifecycle_event; const prefix = NPM_EVENTS.has(event) ? '' : 'run '; - const client = + const isYarn = typeof process.env.npm_config_user_agent === 'string' && - process.env.npm_config_user_agent.match('yarn') !== null - ? 'yarn' - : 'npm'; + process.env.npm_config_user_agent.match('yarn') !== null; + const client = isYarn ? 'yarn' : 'npm'; const scriptUsesJest = typeof process.env.npm_lifecycle_script === 'string' && process.env.npm_lifecycle_script.indexOf('jest') !== -1; @@ -141,7 +140,11 @@ export default class SummaryReporter extends BaseReporter { if (globalConfig.watch) { updateCommand = 'press `u`'; } else if (event && scriptUsesJest) { - updateCommand = `run \`${client + ' ' + prefix + event} -u\``; + updateCommand = `run \`${client + + ' ' + + prefix + + event + + (isYarn ? '' : ' --')} -u\``; } else { updateCommand = 're-run jest with `-u`'; } From 270362a605be293d7d8ec0bb8b12a03685f9ae83 Mon Sep 17 00:00:00 2001 From: kdnakt Date: Wed, 24 Jan 2018 02:33:03 +0900 Subject: [PATCH 02/12] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ea43efcfcf5..7eb987e89d04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ * `[jest]` Add `import-local` to `jest` package. ([#5353](https://github.com/facebook/jest/pull/5353)) +* `[jest-cli]` Fix npm update command for snapshot summary. +([#5376](https://github.com/facebook/jest/pull/5376)) ## jest 22.1.4 From 84576402e793a74420325540aae70567c4fca8dc Mon Sep 17 00:00:00 2001 From: kdnakt Date: Thu, 25 Jan 2018 04:49:30 +0900 Subject: [PATCH 03/12] add testcase for summary_reporter.js --- .../__tests__/summary_reporter.test.js | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js diff --git a/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js b/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js new file mode 100644 index 000000000000..4666d1f6da4e --- /dev/null +++ b/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +'use strict'; + +const env = Object.assign({}, process.env); +const write = process.stderr.write; +let SummaryReporter; + +beforeEach(() => { + SummaryReporter = require('../summary_reporter').default; +}); + +afterEach(() => { + process.env = env; + process.stderr.write = write; +}); + +describe('onRunComplete', () => { + test('myTest', () => { + process.env.npm_config_user_agent = 'npm'; + process.env.npm_lifecycle_event = 'test'; + process.env.npm_lifecycle_script = 'jest'; + const results = []; + process.stderr.write = result => results.push(result); + const testReporter = new SummaryReporter({ + watch: false, + }); + const aggregatedResults = { + numTotalTestSuites: 1, + snapshot: { + filesUnmatched: 1, + unmatched: 2, + }, + testResults: {}, + }; + testReporter.onRunComplete(new Set(), aggregatedResults); + expect(results[0]).toMatch('\u001b[1mSnapshot Summary\u001b[22m'); + expect(results[1]).toMatch( + '\u001b[1m\u001b[31m › 2 snapshot tests\u001b[39m\u001b[22m failed in 1 test suite. ' + + '\u001b[2mInspect your code changes or run `npm test -- -u` to update them.\u001b[22m', + ); + }); +}); From 80cd6960efc2a56f4248f710fd1b55150e146bb6 Mon Sep 17 00:00:00 2001 From: kdnakt Date: Thu, 25 Jan 2018 05:12:53 +0900 Subject: [PATCH 04/12] add testcase for yarn --- .../__tests__/summary_reporter.test.js | 44 +++++++++++++------ 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js b/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js index 4666d1f6da4e..7dad397253a4 100644 --- a/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js +++ b/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js @@ -8,35 +8,40 @@ const env = Object.assign({}, process.env); const write = process.stderr.write; +const globalConfig = { + watch: false, +}; +const aggregatedResults = { + numTotalTestSuites: 1, + snapshot: { + filesUnmatched: 1, + unmatched: 2, + }, + testResults: {}, +}; + +let results = []; let SummaryReporter; beforeEach(() => { + process.env.npm_lifecycle_event = 'test'; + process.env.npm_lifecycle_script = 'jest'; + process.stderr.write = result => results.push(result); SummaryReporter = require('../summary_reporter').default; }); afterEach(() => { + results = []; process.env = env; process.stderr.write = write; }); describe('onRunComplete', () => { - test('myTest', () => { + test('npm test', () => { process.env.npm_config_user_agent = 'npm'; - process.env.npm_lifecycle_event = 'test'; - process.env.npm_lifecycle_script = 'jest'; const results = []; process.stderr.write = result => results.push(result); - const testReporter = new SummaryReporter({ - watch: false, - }); - const aggregatedResults = { - numTotalTestSuites: 1, - snapshot: { - filesUnmatched: 1, - unmatched: 2, - }, - testResults: {}, - }; + const testReporter = new SummaryReporter(globalConfig); testReporter.onRunComplete(new Set(), aggregatedResults); expect(results[0]).toMatch('\u001b[1mSnapshot Summary\u001b[22m'); expect(results[1]).toMatch( @@ -44,4 +49,15 @@ describe('onRunComplete', () => { '\u001b[2mInspect your code changes or run `npm test -- -u` to update them.\u001b[22m', ); }); + + test('yarn test', () => { + process.env.npm_config_user_agent = 'yarn'; + const testReporter = new SummaryReporter(globalConfig); + testReporter.onRunComplete(new Set(), aggregatedResults); + expect(results[0]).toMatch('\u001b[1mSnapshot Summary\u001b[22m'); + expect(results[1]).toMatch( + '\u001b[1m\u001b[31m › 2 snapshot tests\u001b[39m\u001b[22m failed in 1 test suite. ' + + '\u001b[2mInspect your code changes or run `yarn test -u` to update them.\u001b[22m', + ); + }); }); From 85d5b9d67e0eaab5803490d2c6675827fd23ae1d Mon Sep 17 00:00:00 2001 From: kdnakt Date: Thu, 25 Jan 2018 05:21:40 +0900 Subject: [PATCH 05/12] Update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd8b3afdee6f..5761f0a7affa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,8 @@ * `[expect]` Support class instances in `.toHaveProperty()` matcher. ([#5367](https://github.com/facebook/jest/pull/5367)) * `[jest-cli]` Fix npm update command for snapshot summary. - ([#5376](https://github.com/facebook/jest/pull/5376)) + ([#5376](https://github.com/facebook/jest/pull/5376), + [5389](https://github.com/facebook/jest/pull/5389/)) * `[expect]` Make `rejects` and `resolves` synchronously validate its argument. ([#5364](https://github.com/facebook/jest/pull/5364)) From c5bdfa37925a79e14cc2ed0246863dd4d407591f Mon Sep 17 00:00:00 2001 From: kdnakt Date: Fri, 26 Jan 2018 09:49:47 +0900 Subject: [PATCH 06/12] import SummaryReporter at the top --- .../jest-cli/src/reporters/__tests__/summary_reporter.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js b/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js index 7dad397253a4..bfd14b9bd338 100644 --- a/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js +++ b/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js @@ -6,6 +6,8 @@ */ 'use strict'; +import SummaryReporter from '../summary_reporter'; + const env = Object.assign({}, process.env); const write = process.stderr.write; const globalConfig = { @@ -21,13 +23,11 @@ const aggregatedResults = { }; let results = []; -let SummaryReporter; beforeEach(() => { process.env.npm_lifecycle_event = 'test'; process.env.npm_lifecycle_script = 'jest'; process.stderr.write = result => results.push(result); - SummaryReporter = require('../summary_reporter').default; }); afterEach(() => { From 210987eb48167c0183385d668df8bf0d4e9608fd Mon Sep 17 00:00:00 2001 From: kdnakt Date: Fri, 26 Jan 2018 09:56:57 +0900 Subject: [PATCH 07/12] remove duplicated definition of results --- .../jest-cli/src/reporters/__tests__/summary_reporter.test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js b/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js index bfd14b9bd338..c5cb1d0d1ea1 100644 --- a/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js +++ b/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js @@ -39,7 +39,6 @@ afterEach(() => { describe('onRunComplete', () => { test('npm test', () => { process.env.npm_config_user_agent = 'npm'; - const results = []; process.stderr.write = result => results.push(result); const testReporter = new SummaryReporter(globalConfig); testReporter.onRunComplete(new Set(), aggregatedResults); From 85707c6d416be977021af64f3bcc4f544152ae63 Mon Sep 17 00:00:00 2001 From: kdnakt Date: Fri, 26 Jan 2018 23:54:51 +0900 Subject: [PATCH 08/12] remove description --- .../__tests__/summary_reporter.test.js | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js b/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js index c5cb1d0d1ea1..1d7425506020 100644 --- a/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js +++ b/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js @@ -36,27 +36,25 @@ afterEach(() => { process.stderr.write = write; }); -describe('onRunComplete', () => { - test('npm test', () => { - process.env.npm_config_user_agent = 'npm'; - process.stderr.write = result => results.push(result); - const testReporter = new SummaryReporter(globalConfig); - testReporter.onRunComplete(new Set(), aggregatedResults); - expect(results[0]).toMatch('\u001b[1mSnapshot Summary\u001b[22m'); - expect(results[1]).toMatch( - '\u001b[1m\u001b[31m › 2 snapshot tests\u001b[39m\u001b[22m failed in 1 test suite. ' + - '\u001b[2mInspect your code changes or run `npm test -- -u` to update them.\u001b[22m', - ); - }); +test('npm test', () => { + process.env.npm_config_user_agent = 'npm'; + process.stderr.write = result => results.push(result); + const testReporter = new SummaryReporter(globalConfig); + testReporter.onRunComplete(new Set(), aggregatedResults); + expect(results[0]).toMatch('\u001b[1mSnapshot Summary\u001b[22m'); + expect(results[1]).toMatch( + '\u001b[1m\u001b[31m › 2 snapshot tests\u001b[39m\u001b[22m failed in 1 test suite. ' + + '\u001b[2mInspect your code changes or run `npm test -- -u` to update them.\u001b[22m', + ); +}); - test('yarn test', () => { - process.env.npm_config_user_agent = 'yarn'; - const testReporter = new SummaryReporter(globalConfig); - testReporter.onRunComplete(new Set(), aggregatedResults); - expect(results[0]).toMatch('\u001b[1mSnapshot Summary\u001b[22m'); - expect(results[1]).toMatch( - '\u001b[1m\u001b[31m › 2 snapshot tests\u001b[39m\u001b[22m failed in 1 test suite. ' + - '\u001b[2mInspect your code changes or run `yarn test -u` to update them.\u001b[22m', - ); - }); +test('yarn test', () => { + process.env.npm_config_user_agent = 'yarn'; + const testReporter = new SummaryReporter(globalConfig); + testReporter.onRunComplete(new Set(), aggregatedResults); + expect(results[0]).toMatch('\u001b[1mSnapshot Summary\u001b[22m'); + expect(results[1]).toMatch( + '\u001b[1m\u001b[31m › 2 snapshot tests\u001b[39m\u001b[22m failed in 1 test suite. ' + + '\u001b[2mInspect your code changes or run `yarn test -u` to update them.\u001b[22m', + ); }); From 8f99c3e879fa4ed9fdfde5163a256626b153099e Mon Sep 17 00:00:00 2001 From: kdnakt Date: Sat, 27 Jan 2018 00:27:17 +0900 Subject: [PATCH 09/12] add snapshot test --- .../__snapshots__/summary_reporter.test.js.snap | 13 +++++++++++++ .../reporters/__tests__/summary_reporter.test.js | 12 ++---------- 2 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap new file mode 100644 index 000000000000..6616410eb050 --- /dev/null +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap @@ -0,0 +1,13 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`npm test 1`] = ` +"Snapshot Summary + › 2 snapshot tests failed in 1 test suite. Inspect your code changes or run \`npm test -- -u\` to update them. +" +`; + +exports[`yarn test 1`] = ` +"Snapshot Summary + › 2 snapshot tests failed in 1 test suite. Inspect your code changes or run \`yarn test -u\` to update them. +" +`; diff --git a/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js b/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js index 1d7425506020..2758606f680a 100644 --- a/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js +++ b/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js @@ -41,20 +41,12 @@ test('npm test', () => { process.stderr.write = result => results.push(result); const testReporter = new SummaryReporter(globalConfig); testReporter.onRunComplete(new Set(), aggregatedResults); - expect(results[0]).toMatch('\u001b[1mSnapshot Summary\u001b[22m'); - expect(results[1]).toMatch( - '\u001b[1m\u001b[31m › 2 snapshot tests\u001b[39m\u001b[22m failed in 1 test suite. ' + - '\u001b[2mInspect your code changes or run `npm test -- -u` to update them.\u001b[22m', - ); + expect(results[0] + results[1]).toMatchSnapshot(); }); test('yarn test', () => { process.env.npm_config_user_agent = 'yarn'; const testReporter = new SummaryReporter(globalConfig); testReporter.onRunComplete(new Set(), aggregatedResults); - expect(results[0]).toMatch('\u001b[1mSnapshot Summary\u001b[22m'); - expect(results[1]).toMatch( - '\u001b[1m\u001b[31m › 2 snapshot tests\u001b[39m\u001b[22m failed in 1 test suite. ' + - '\u001b[2mInspect your code changes or run `yarn test -u` to update them.\u001b[22m', - ); + expect(results[0] + results[1]).toMatchSnapshot(); }); From c2b608a2c8236bea411090eb6f56253c2a5bbb77 Mon Sep 17 00:00:00 2001 From: kdnakt Date: Sat, 27 Jan 2018 01:01:32 +0900 Subject: [PATCH 10/12] update test title --- .../__tests__/__snapshots__/summary_reporter.test.js.snap | 4 ++-- .../jest-cli/src/reporters/__tests__/summary_reporter.test.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap index 6616410eb050..f94931b8236f 100644 --- a/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap @@ -1,12 +1,12 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`npm test 1`] = ` +exports[`snapshots needs update with npm test 1`] = ` "Snapshot Summary › 2 snapshot tests failed in 1 test suite. Inspect your code changes or run \`npm test -- -u\` to update them. " `; -exports[`yarn test 1`] = ` +exports[`snapshots needs update with yarn test 1`] = ` "Snapshot Summary › 2 snapshot tests failed in 1 test suite. Inspect your code changes or run \`yarn test -u\` to update them. " diff --git a/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js b/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js index 2758606f680a..1dd88d6f9499 100644 --- a/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js +++ b/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js @@ -36,7 +36,7 @@ afterEach(() => { process.stderr.write = write; }); -test('npm test', () => { +test('snapshots needs update with npm test', () => { process.env.npm_config_user_agent = 'npm'; process.stderr.write = result => results.push(result); const testReporter = new SummaryReporter(globalConfig); @@ -44,7 +44,7 @@ test('npm test', () => { expect(results[0] + results[1]).toMatchSnapshot(); }); -test('yarn test', () => { +test('snapshots needs update with yarn test', () => { process.env.npm_config_user_agent = 'yarn'; const testReporter = new SummaryReporter(globalConfig); testReporter.onRunComplete(new Set(), aggregatedResults); From 38c10f8e95ff016a35ab0cbae3bfa040890c5589 Mon Sep 17 00:00:00 2001 From: kdnakt Date: Sat, 27 Jan 2018 15:04:03 +0900 Subject: [PATCH 11/12] remove duplicated line --- .../jest-cli/src/reporters/__tests__/summary_reporter.test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js b/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js index 1dd88d6f9499..bac3f672d5be 100644 --- a/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js +++ b/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js @@ -38,7 +38,6 @@ afterEach(() => { test('snapshots needs update with npm test', () => { process.env.npm_config_user_agent = 'npm'; - process.stderr.write = result => results.push(result); const testReporter = new SummaryReporter(globalConfig); testReporter.onRunComplete(new Set(), aggregatedResults); expect(results[0] + results[1]).toMatchSnapshot(); From 480269f36389a9e53622795f4e6abfcfdac35c86 Mon Sep 17 00:00:00 2001 From: kdnakt Date: Sat, 27 Jan 2018 19:29:09 +0900 Subject: [PATCH 12/12] add missing attributes for test results --- .../__snapshots__/summary_reporter.test.js.snap | 12 ++++++++++++ .../reporters/__tests__/summary_reporter.test.js | 13 +++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap index f94931b8236f..55fb2f7428f7 100644 --- a/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap @@ -3,11 +3,23 @@ exports[`snapshots needs update with npm test 1`] = ` "Snapshot Summary › 2 snapshot tests failed in 1 test suite. Inspect your code changes or run \`npm test -- -u\` to update them. + +Test Suites: 1 failed, 1 total +Tests: 1 failed, 1 total +Snapshots: 2 failed, 2 total +Time: 0.01s +Ran all test suites. " `; exports[`snapshots needs update with yarn test 1`] = ` "Snapshot Summary › 2 snapshot tests failed in 1 test suite. Inspect your code changes or run \`yarn test -u\` to update them. + +Test Suites: 1 failed, 1 total +Tests: 1 failed, 1 total +Snapshots: 2 failed, 2 total +Time: 0.01s +Ran all test suites. " `; diff --git a/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js b/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js index bac3f672d5be..445815207efd 100644 --- a/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js +++ b/packages/jest-cli/src/reporters/__tests__/summary_reporter.test.js @@ -9,16 +9,23 @@ import SummaryReporter from '../summary_reporter'; const env = Object.assign({}, process.env); +const now = Date.now; const write = process.stderr.write; const globalConfig = { watch: false, }; const aggregatedResults = { + numFailedTestSuites: 1, + numFailedTests: 1, + numPassedTestSuites: 0, numTotalTestSuites: 1, + numTotalTests: 1, snapshot: { filesUnmatched: 1, + total: 2, unmatched: 2, }, + startTime: 0, testResults: {}, }; @@ -28,24 +35,26 @@ beforeEach(() => { process.env.npm_lifecycle_event = 'test'; process.env.npm_lifecycle_script = 'jest'; process.stderr.write = result => results.push(result); + Date.now = () => 10; }); afterEach(() => { results = []; process.env = env; process.stderr.write = write; + Date.now = now; }); test('snapshots needs update with npm test', () => { process.env.npm_config_user_agent = 'npm'; const testReporter = new SummaryReporter(globalConfig); testReporter.onRunComplete(new Set(), aggregatedResults); - expect(results[0] + results[1]).toMatchSnapshot(); + expect(results.join('')).toMatchSnapshot(); }); test('snapshots needs update with yarn test', () => { process.env.npm_config_user_agent = 'yarn'; const testReporter = new SummaryReporter(globalConfig); testReporter.onRunComplete(new Set(), aggregatedResults); - expect(results[0] + results[1]).toMatchSnapshot(); + expect(results.join('')).toMatchSnapshot(); });