From 3036f7e64abae49f1649fc8fe973f4c4479bda2f Mon Sep 17 00:00:00 2001 From: Trevor Brindle Date: Tue, 5 Sep 2017 14:28:40 -0400 Subject: [PATCH 01/14] add clearCache cli command --- packages/jest-cli/src/cli/args.js | 7 +++++++ packages/jest-cli/src/cli/index.js | 7 +++++++ packages/jest-util/src/index.js | 16 ++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/packages/jest-cli/src/cli/args.js b/packages/jest-cli/src/cli/args.js index e60f377ce002..8f2ca02a332e 100644 --- a/packages/jest-cli/src/cli/args.js +++ b/packages/jest-cli/src/cli/args.js @@ -117,6 +117,13 @@ export const options = { ' prevent snapshots from being written unless explicitly requested.', type: 'boolean', }, + clearCache: { + default: undefined, + description: + 'Clear default directory Jest uses for cache and exits.' + + 'Default directory can be found by calling jest --showConfig', + type: 'boolean', + }, clearMocks: { default: undefined, description: diff --git a/packages/jest-cli/src/cli/index.js b/packages/jest-cli/src/cli/index.js index 30bddce8ef9a..59114da7f0d2 100644 --- a/packages/jest-cli/src/cli/index.js +++ b/packages/jest-cli/src/cli/index.js @@ -15,6 +15,7 @@ import { Console, clearLine, createDirectory, + clearDirectory, validateCLIOptions, } from 'jest-util'; import {readConfig} from 'jest-config'; @@ -68,6 +69,12 @@ export const runCLI = async ( outputStream, ); + if (argv.clearCache) { + clearDirectory(configs[0].cacheDirectory); + process.stdout.write(`Cleared ${configs[0].cacheDirectory}\n`); + process.exit(0); + } + await _run( globalConfig, configs, diff --git a/packages/jest-util/src/index.js b/packages/jest-util/src/index.js index 859398dd5bc4..70c1e0400f00 100644 --- a/packages/jest-util/src/index.js +++ b/packages/jest-util/src/index.js @@ -8,6 +8,7 @@ */ import mkdirp from 'mkdirp'; +import fs from 'graceful-fs'; import BufferedConsole from './buffered_console'; import clearLine from './clear_line'; @@ -30,6 +31,20 @@ const createDirectory = (path: string) => { } }; +const clearDirectory = (path: string) => { + if (fs.existsSync(path)) { + fs.readdirSync(path).map(file => { + const filePath = `${path}/${file}`; + if (fs.lstatSync(filePath).isDirectory()) { + clearDirectory(filePath); + } else { + fs.unlinkSync(filePath); + } + }); + fs.rmdirSync(path); + } +}; + module.exports = { BufferedConsole, Console, @@ -37,6 +52,7 @@ module.exports = { NullConsole, clearLine, createDirectory, + clearDirectory, formatTestResults, getConsoleOutput, installCommonGlobals, From 7615c79e98bf5fffade003702f407653d2d4cf0e Mon Sep 17 00:00:00 2001 From: Trevor Brindle Date: Wed, 6 Sep 2017 10:47:20 -0400 Subject: [PATCH 02/14] fix lint issue - sort-keys --- packages/jest-util/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/jest-util/src/index.js b/packages/jest-util/src/index.js index 70c1e0400f00..481c8e443388 100644 --- a/packages/jest-util/src/index.js +++ b/packages/jest-util/src/index.js @@ -50,9 +50,9 @@ module.exports = { Console, FakeTimers, NullConsole, + clearDirectory, clearLine, createDirectory, - clearDirectory, formatTestResults, getConsoleOutput, installCommonGlobals, From 04b495d8115243dff7e0d9b537f95889d2781df3 Mon Sep 17 00:00:00 2001 From: Trevor Brindle Date: Wed, 6 Sep 2017 10:53:27 -0400 Subject: [PATCH 03/14] clear all projects cacheDirectory - map over all configs --- packages/jest-cli/src/cli/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/jest-cli/src/cli/index.js b/packages/jest-cli/src/cli/index.js index 59114da7f0d2..fd1f1f315add 100644 --- a/packages/jest-cli/src/cli/index.js +++ b/packages/jest-cli/src/cli/index.js @@ -70,8 +70,11 @@ export const runCLI = async ( ); if (argv.clearCache) { - clearDirectory(configs[0].cacheDirectory); - process.stdout.write(`Cleared ${configs[0].cacheDirectory}\n`); + configs.map(config => { + clearDirectory(config.cacheDirectory); + process.stdout.write(`Cleared ${config.cacheDirectory}\n`); + }); + process.exit(0); } From d63c815af36fafef0cd5f84035130d106cc4ab67 Mon Sep 17 00:00:00 2001 From: Trevor Brindle Date: Wed, 6 Sep 2017 10:54:10 -0400 Subject: [PATCH 04/14] improve wording in arg description --- packages/jest-cli/src/cli/args.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/jest-cli/src/cli/args.js b/packages/jest-cli/src/cli/args.js index 8f2ca02a332e..4e8308d742fb 100644 --- a/packages/jest-cli/src/cli/args.js +++ b/packages/jest-cli/src/cli/args.js @@ -120,7 +120,7 @@ export const options = { clearCache: { default: undefined, description: - 'Clear default directory Jest uses for cache and exits.' + + 'Clears the configured Jest cache directory and then exits.' + 'Default directory can be found by calling jest --showConfig', type: 'boolean', }, From 0a7a2c2e3ff6458f6a0fa2f4d7dee1588c9c6002 Mon Sep 17 00:00:00 2001 From: Trevor Brindle Date: Wed, 6 Sep 2017 11:00:42 -0400 Subject: [PATCH 05/14] use path.join instead of string concat - rename path arg to directoryPath for less confusion --- packages/jest-util/src/index.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/jest-util/src/index.js b/packages/jest-util/src/index.js index 481c8e443388..79d9308462b2 100644 --- a/packages/jest-util/src/index.js +++ b/packages/jest-util/src/index.js @@ -9,6 +9,7 @@ import mkdirp from 'mkdirp'; import fs from 'graceful-fs'; +import path from 'path'; import BufferedConsole from './buffered_console'; import clearLine from './clear_line'; @@ -31,17 +32,17 @@ const createDirectory = (path: string) => { } }; -const clearDirectory = (path: string) => { - if (fs.existsSync(path)) { - fs.readdirSync(path).map(file => { - const filePath = `${path}/${file}`; +const clearDirectory = (directoryPath: string) => { + if (fs.existsSync(directoryPath)) { + fs.readdirSync(directoryPath).map(file => { + const filePath = path.join(directoryPath, file); if (fs.lstatSync(filePath).isDirectory()) { clearDirectory(filePath); } else { fs.unlinkSync(filePath); } }); - fs.rmdirSync(path); + fs.rmdirSync(directoryPath); } }; From 4595517915ddd31cb55e5fd58f210eb063a85b25 Mon Sep 17 00:00:00 2001 From: Trevor Brindle Date: Fri, 8 Sep 2017 11:48:30 -0400 Subject: [PATCH 06/14] remove clearDirectory function in favor of rimraf --- packages/jest-cli/package.json | 1 + packages/jest-cli/src/cli/index.js | 7 +++++-- packages/jest-util/src/index.js | 17 ----------------- 3 files changed, 6 insertions(+), 19 deletions(-) diff --git a/packages/jest-cli/package.json b/packages/jest-cli/package.json index 6ba1066c5fab..01af8aeb9802 100644 --- a/packages/jest-cli/package.json +++ b/packages/jest-cli/package.json @@ -27,6 +27,7 @@ "micromatch": "^2.3.11", "node-notifier": "^5.1.2", "pify": "^3.0.0", + "rimraf": "^2.5.4", "slash": "^1.0.0", "string-length": "^2.0.0", "strip-ansi": "^4.0.0", diff --git a/packages/jest-cli/src/cli/index.js b/packages/jest-cli/src/cli/index.js index fd1f1f315add..ed4413ad786b 100644 --- a/packages/jest-cli/src/cli/index.js +++ b/packages/jest-cli/src/cli/index.js @@ -15,7 +15,6 @@ import { Console, clearLine, createDirectory, - clearDirectory, validateCLIOptions, } from 'jest-util'; import {readConfig} from 'jest-config'; @@ -33,6 +32,7 @@ import Runtime from 'jest-runtime'; import TestWatcher from '../test_watcher'; import watch from '../watch'; import yargs from 'yargs'; +import rimraf from 'rimraf'; export async function run(maybeArgv?: Argv, project?: Path) { const argv: Argv = buildArgv(maybeArgv, project); @@ -71,7 +71,10 @@ export const runCLI = async ( if (argv.clearCache) { configs.map(config => { - clearDirectory(config.cacheDirectory); + rimraf(config.cacheDirectory, [], () => { + process.stderr.write(`Unable to clear ${config.cacheDirectory}\n`); + process.exit(1); + }); process.stdout.write(`Cleared ${config.cacheDirectory}\n`); }); diff --git a/packages/jest-util/src/index.js b/packages/jest-util/src/index.js index 79d9308462b2..859398dd5bc4 100644 --- a/packages/jest-util/src/index.js +++ b/packages/jest-util/src/index.js @@ -8,8 +8,6 @@ */ import mkdirp from 'mkdirp'; -import fs from 'graceful-fs'; -import path from 'path'; import BufferedConsole from './buffered_console'; import clearLine from './clear_line'; @@ -32,26 +30,11 @@ const createDirectory = (path: string) => { } }; -const clearDirectory = (directoryPath: string) => { - if (fs.existsSync(directoryPath)) { - fs.readdirSync(directoryPath).map(file => { - const filePath = path.join(directoryPath, file); - if (fs.lstatSync(filePath).isDirectory()) { - clearDirectory(filePath); - } else { - fs.unlinkSync(filePath); - } - }); - fs.rmdirSync(directoryPath); - } -}; - module.exports = { BufferedConsole, Console, FakeTimers, NullConsole, - clearDirectory, clearLine, createDirectory, formatTestResults, From 40efb06a118dab21497448abba8a4a7828d3335d Mon Sep 17 00:00:00 2001 From: Trevor Brindle Date: Fri, 8 Sep 2017 11:52:16 -0400 Subject: [PATCH 07/14] allow clearCache loop to run before failing with exit 1 --- packages/jest-cli/src/cli/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/jest-cli/src/cli/index.js b/packages/jest-cli/src/cli/index.js index ed4413ad786b..4ced84130d33 100644 --- a/packages/jest-cli/src/cli/index.js +++ b/packages/jest-cli/src/cli/index.js @@ -70,14 +70,20 @@ export const runCLI = async ( ); if (argv.clearCache) { + let clearCacheError; + configs.map(config => { rimraf(config.cacheDirectory, [], () => { + clearCacheError = true; process.stderr.write(`Unable to clear ${config.cacheDirectory}\n`); - process.exit(1); }); process.stdout.write(`Cleared ${config.cacheDirectory}\n`); }); + if (clearCacheError) { + process.exit(1); + } + process.exit(0); } From a4b9ea6a805631b98e3f4dc00f9361c10f4b7fb8 Mon Sep 17 00:00:00 2001 From: Trevor Brindle Date: Fri, 8 Sep 2017 11:53:06 -0400 Subject: [PATCH 08/14] add clear_cache integration test - yarn run jest -- -t 'jest --clearCache' $ node ./packages/jest-cli/bin/jest.js "-t" "jest --clearCache" PASS integration_tests/__tests__/clear_cache.test.js Test Suites: 165 skipped, 1 passed, 1 of 166 total Tests: 1573 skipped, 1 passed, 1574 total Snapshots: 0 total --- .../__tests__/clear_cache.test.js | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 integration_tests/__tests__/clear_cache.test.js diff --git a/integration_tests/__tests__/clear_cache.test.js b/integration_tests/__tests__/clear_cache.test.js new file mode 100644 index 000000000000..644127ad5826 --- /dev/null +++ b/integration_tests/__tests__/clear_cache.test.js @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @flow + */ +'use strict'; + +const fs = require('fs'); +const os = require('os'); +const path = require('path'); +const {cleanup, writeFiles} = require('../utils'); +const runJest = require('../runJest'); +const skipOnWindows = require('../../scripts/skip_on_windows'); + +const CACHE = path.resolve(os.tmpdir(), 'clear_cache_directory'); +const DIR = path.resolve(os.tmpdir(), 'clear_cache'); + +skipOnWindows.suite(); + +beforeEach(() => cleanup(DIR)); +afterAll(() => cleanup(DIR)); + +describe('jest --clearCache', () => { + test('clearing cache results in exit status 0', () => { + writeFiles(DIR, { + '.watchmanconfig': '', + 'package.json': '{}', + }); + + const {status, stdout, stderr} = runJest(DIR, [ + '--clearCache', + `--cacheDirectory=${CACHE}`, + ]); + + expect(fs.existsSync(CACHE)).toBe(false); + expect(stdout).toBe(`Cleared ${CACHE}\n`); + expect(stderr.trim()).toBe(''); + expect(status).toBe(0); + }); +}); From 613feca79ec67fc83b0a1a50bbb7c90de092e24b Mon Sep 17 00:00:00 2001 From: Trevor Brindle Date: Fri, 8 Sep 2017 20:18:05 -0400 Subject: [PATCH 09/14] fix integration test - actually create directory with real test - check for directory, then delete - use rimraf.sync - remove temp var --- .../__tests__/clear_cache.test.js | 19 ++++++++----------- .../clear_cache/__tests__/clear_cache.test.js | 10 ++++++++++ integration_tests/clear_cache/package.json | 5 +++++ packages/jest-cli/src/cli/index.js | 11 +---------- 4 files changed, 24 insertions(+), 21 deletions(-) create mode 100644 integration_tests/clear_cache/__tests__/clear_cache.test.js create mode 100644 integration_tests/clear_cache/package.json diff --git a/integration_tests/__tests__/clear_cache.test.js b/integration_tests/__tests__/clear_cache.test.js index 644127ad5826..86c9c17e0801 100644 --- a/integration_tests/__tests__/clear_cache.test.js +++ b/integration_tests/__tests__/clear_cache.test.js @@ -12,26 +12,23 @@ const fs = require('fs'); const os = require('os'); const path = require('path'); -const {cleanup, writeFiles} = require('../utils'); const runJest = require('../runJest'); const skipOnWindows = require('../../scripts/skip_on_windows'); +const rimraf = require('rimraf'); const CACHE = path.resolve(os.tmpdir(), 'clear_cache_directory'); -const DIR = path.resolve(os.tmpdir(), 'clear_cache'); skipOnWindows.suite(); -beforeEach(() => cleanup(DIR)); -afterAll(() => cleanup(DIR)); - describe('jest --clearCache', () => { - test('clearing cache results in exit status 0', () => { - writeFiles(DIR, { - '.watchmanconfig': '', - 'package.json': '{}', - }); + test('normal run results in cache directory being written', () => { + const {status} = runJest('clear_cache', [`--cacheDirectory=${CACHE}`]); - const {status, stdout, stderr} = runJest(DIR, [ + expect(fs.existsSync(CACHE)).toBe(true); + expect(status).toBe(0); + }); + test('clearCache results in deleted directory and exit status 0', () => { + const {status, stdout, stderr} = runJest('clear_cache', [ '--clearCache', `--cacheDirectory=${CACHE}`, ]); diff --git a/integration_tests/clear_cache/__tests__/clear_cache.test.js b/integration_tests/clear_cache/__tests__/clear_cache.test.js new file mode 100644 index 000000000000..f09a606fe9eb --- /dev/null +++ b/integration_tests/clear_cache/__tests__/clear_cache.test.js @@ -0,0 +1,10 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ +'use strict'; + +test('stub', () => expect(1).toBe(1)); diff --git a/integration_tests/clear_cache/package.json b/integration_tests/clear_cache/package.json new file mode 100644 index 000000000000..148788b25446 --- /dev/null +++ b/integration_tests/clear_cache/package.json @@ -0,0 +1,5 @@ +{ + "jest": { + "testEnvironment": "node" + } +} diff --git a/packages/jest-cli/src/cli/index.js b/packages/jest-cli/src/cli/index.js index 4ced84130d33..fea62456cb38 100644 --- a/packages/jest-cli/src/cli/index.js +++ b/packages/jest-cli/src/cli/index.js @@ -70,20 +70,11 @@ export const runCLI = async ( ); if (argv.clearCache) { - let clearCacheError; - configs.map(config => { - rimraf(config.cacheDirectory, [], () => { - clearCacheError = true; - process.stderr.write(`Unable to clear ${config.cacheDirectory}\n`); - }); + rimraf.sync(config.cacheDirectory); process.stdout.write(`Cleared ${config.cacheDirectory}\n`); }); - if (clearCacheError) { - process.exit(1); - } - process.exit(0); } From 82d01b3c94eb103ab12bc2a6aa5cbf1ed5bcf4c5 Mon Sep 17 00:00:00 2001 From: Trevor Brindle Date: Wed, 11 Oct 2017 10:02:29 -0400 Subject: [PATCH 10/14] changes per PR comments --- integration_tests/__tests__/clear_cache.test.js | 4 ---- packages/jest-cli/src/cli/args.js | 2 +- packages/jest-cli/src/cli/index.js | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/integration_tests/__tests__/clear_cache.test.js b/integration_tests/__tests__/clear_cache.test.js index 86c9c17e0801..a4190810e324 100644 --- a/integration_tests/__tests__/clear_cache.test.js +++ b/integration_tests/__tests__/clear_cache.test.js @@ -13,13 +13,9 @@ const fs = require('fs'); const os = require('os'); const path = require('path'); const runJest = require('../runJest'); -const skipOnWindows = require('../../scripts/skip_on_windows'); -const rimraf = require('rimraf'); const CACHE = path.resolve(os.tmpdir(), 'clear_cache_directory'); -skipOnWindows.suite(); - describe('jest --clearCache', () => { test('normal run results in cache directory being written', () => { const {status} = runJest('clear_cache', [`--cacheDirectory=${CACHE}`]); diff --git a/packages/jest-cli/src/cli/args.js b/packages/jest-cli/src/cli/args.js index 4e8308d742fb..018b7cbd619d 100644 --- a/packages/jest-cli/src/cli/args.js +++ b/packages/jest-cli/src/cli/args.js @@ -120,7 +120,7 @@ export const options = { clearCache: { default: undefined, description: - 'Clears the configured Jest cache directory and then exits.' + + 'Clears the configured Jest cache directory and then exits. ' + 'Default directory can be found by calling jest --showConfig', type: 'boolean', }, diff --git a/packages/jest-cli/src/cli/index.js b/packages/jest-cli/src/cli/index.js index fea62456cb38..752fbeb8cf04 100644 --- a/packages/jest-cli/src/cli/index.js +++ b/packages/jest-cli/src/cli/index.js @@ -70,7 +70,7 @@ export const runCLI = async ( ); if (argv.clearCache) { - configs.map(config => { + configs.forEach(config => { rimraf.sync(config.cacheDirectory); process.stdout.write(`Cleared ${config.cacheDirectory}\n`); }); From 2cc04eb012846da19d65f0b211c089a70eba0df4 Mon Sep 17 00:00:00 2001 From: Trevor Brindle Date: Wed, 11 Oct 2017 10:36:52 -0400 Subject: [PATCH 11/14] update license headers to MIT --- integration_tests/__tests__/clear_cache.test.js | 5 ++--- .../clear_cache/__tests__/clear_cache.test.js | 7 ++++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/integration_tests/__tests__/clear_cache.test.js b/integration_tests/__tests__/clear_cache.test.js index a4190810e324..5eb2432c7739 100644 --- a/integration_tests/__tests__/clear_cache.test.js +++ b/integration_tests/__tests__/clear_cache.test.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. * * @flow */ diff --git a/integration_tests/clear_cache/__tests__/clear_cache.test.js b/integration_tests/clear_cache/__tests__/clear_cache.test.js index f09a606fe9eb..61e6e0498f8d 100644 --- a/integration_tests/clear_cache/__tests__/clear_cache.test.js +++ b/integration_tests/clear_cache/__tests__/clear_cache.test.js @@ -1,9 +1,10 @@ /** * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow */ 'use strict'; From cf503fbfb9002a7b8740fb057809c0a8b5836717 Mon Sep 17 00:00:00 2001 From: Trevor Brindle Date: Wed, 11 Oct 2017 10:37:10 -0400 Subject: [PATCH 12/14] add check for cache_dir before deletion --- integration_tests/__tests__/clear_cache.test.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/integration_tests/__tests__/clear_cache.test.js b/integration_tests/__tests__/clear_cache.test.js index 5eb2432c7739..85453263898f 100644 --- a/integration_tests/__tests__/clear_cache.test.js +++ b/integration_tests/__tests__/clear_cache.test.js @@ -17,13 +17,15 @@ const CACHE = path.resolve(os.tmpdir(), 'clear_cache_directory'); describe('jest --clearCache', () => { test('normal run results in cache directory being written', () => { - const {status} = runJest('clear_cache', [`--cacheDirectory=${CACHE}`]); + const { status } = runJest('clear_cache', [`--cacheDirectory=${CACHE}`]); expect(fs.existsSync(CACHE)).toBe(true); expect(status).toBe(0); }); test('clearCache results in deleted directory and exit status 0', () => { - const {status, stdout, stderr} = runJest('clear_cache', [ + expect(fs.existsSync(CACHE)).toBe(true); + + const { status, stdout, stderr } = runJest('clear_cache', [ '--clearCache', `--cacheDirectory=${CACHE}`, ]); From 072428cd2d8bbce946573bd10d4f8ebec9849f2d Mon Sep 17 00:00:00 2001 From: Trevor Brindle Date: Wed, 11 Oct 2017 11:05:24 -0400 Subject: [PATCH 13/14] update license to MIT for pass_with_no_tests.test.js --- integration_tests/__tests__/pass_with_no_tests.test.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/integration_tests/__tests__/pass_with_no_tests.test.js b/integration_tests/__tests__/pass_with_no_tests.test.js index 33b97195d1c8..02598f71e5c7 100644 --- a/integration_tests/__tests__/pass_with_no_tests.test.js +++ b/integration_tests/__tests__/pass_with_no_tests.test.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. * * @flow */ From 46805865d47faaa46532d372ad204168e8239c05 Mon Sep 17 00:00:00 2001 From: Trevor Brindle Date: Wed, 11 Oct 2017 11:09:48 -0400 Subject: [PATCH 14/14] fix lint error --- integration_tests/__tests__/clear_cache.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration_tests/__tests__/clear_cache.test.js b/integration_tests/__tests__/clear_cache.test.js index 85453263898f..a0954fd8edd1 100644 --- a/integration_tests/__tests__/clear_cache.test.js +++ b/integration_tests/__tests__/clear_cache.test.js @@ -17,7 +17,7 @@ const CACHE = path.resolve(os.tmpdir(), 'clear_cache_directory'); describe('jest --clearCache', () => { test('normal run results in cache directory being written', () => { - const { status } = runJest('clear_cache', [`--cacheDirectory=${CACHE}`]); + const {status} = runJest('clear_cache', [`--cacheDirectory=${CACHE}`]); expect(fs.existsSync(CACHE)).toBe(true); expect(status).toBe(0); @@ -25,7 +25,7 @@ describe('jest --clearCache', () => { test('clearCache results in deleted directory and exit status 0', () => { expect(fs.existsSync(CACHE)).toBe(true); - const { status, stdout, stderr } = runJest('clear_cache', [ + const {status, stdout, stderr} = runJest('clear_cache', [ '--clearCache', `--cacheDirectory=${CACHE}`, ]);