diff --git a/packages/jest-cli/package.json b/packages/jest-cli/package.json index e2420ef57553..d9fa33500430 100644 --- a/packages/jest-cli/package.json +++ b/packages/jest-cli/package.json @@ -27,6 +27,7 @@ "jest-runtime": "^22.3.0", "jest-snapshot": "^22.2.0", "jest-util": "^22.3.0", + "jest-validate": "^22.3.0", "jest-worker": "^22.2.2", "micromatch": "^2.3.11", "node-notifier": "^5.2.1", diff --git a/packages/jest-cli/src/cli/index.js b/packages/jest-cli/src/cli/index.js index 42d39276331e..99ae6384555e 100644 --- a/packages/jest-cli/src/cli/index.js +++ b/packages/jest-cli/src/cli/index.js @@ -11,12 +11,8 @@ import type {AggregatedResult} from 'types/TestResult'; import type {Argv} from 'types/Argv'; import type {GlobalConfig, Path, ProjectConfig} from 'types/Config'; -import { - Console, - clearLine, - createDirectory, - validateCLIOptions, -} from 'jest-util'; +import {Console, clearLine, createDirectory} from 'jest-util'; +import {validateCLIOptions} from 'jest-validate'; import {readConfig} from 'jest-config'; import {version as VERSION} from '../../package.json'; import * as args from './args'; diff --git a/packages/jest-repl/package.json b/packages/jest-repl/package.json index ffcf819e9817..2194f887dfd4 100644 --- a/packages/jest-repl/package.json +++ b/packages/jest-repl/package.json @@ -9,7 +9,7 @@ "main": "build/index.js", "dependencies": { "jest-runtime": "^22.3.0", - "jest-util": "^22.3.0", + "jest-validate": "^22.3.0", "repl": "^0.1.3", "yargs": "^10.0.3" }, diff --git a/packages/jest-repl/src/cli/index.js b/packages/jest-repl/src/cli/index.js index 1f6098b3bdcb..7879498040c7 100644 --- a/packages/jest-repl/src/cli/index.js +++ b/packages/jest-repl/src/cli/index.js @@ -12,7 +12,7 @@ import path from 'path'; import Runtime from 'jest-runtime'; import yargs from 'yargs'; -import {validateCLIOptions} from 'jest-util'; +import {validateCLIOptions} from 'jest-validate'; import {version as VERSION} from '../../package.json'; import * as args from './args'; diff --git a/packages/jest-runtime/package.json b/packages/jest-runtime/package.json index 2417df7f71df..6eee9c4ac389 100644 --- a/packages/jest-runtime/package.json +++ b/packages/jest-runtime/package.json @@ -20,6 +20,7 @@ "jest-regex-util": "^22.1.0", "jest-resolve": "^22.3.0", "jest-util": "^22.3.0", + "jest-validate": "^22.3.0", "json-stable-stringify": "^1.0.1", "micromatch": "^2.3.11", "realpath-native": "^1.0.0", diff --git a/packages/jest-runtime/src/cli/index.js b/packages/jest-runtime/src/cli/index.js index a936d5879b14..1d16429b097d 100644 --- a/packages/jest-runtime/src/cli/index.js +++ b/packages/jest-runtime/src/cli/index.js @@ -14,7 +14,8 @@ import chalk from 'chalk'; import os from 'os'; import path from 'path'; import yargs from 'yargs'; -import {Console, setGlobal, validateCLIOptions} from 'jest-util'; +import {Console, setGlobal} from 'jest-util'; +import {validateCLIOptions} from 'jest-validate'; import {readConfig} from 'jest-config'; // eslint-disable-next-line import/default import Runtime from '../'; diff --git a/packages/jest-util/src/index.js b/packages/jest-util/src/index.js index 0a238fc15800..1b3a6cf27b20 100644 --- a/packages/jest-util/src/index.js +++ b/packages/jest-util/src/index.js @@ -20,7 +20,6 @@ import installCommonGlobals from './install_common_globals'; import NullConsole from './null_console'; import isInteractive from './is_interative'; import setGlobal from './set_global'; -import validateCLIOptions from './validate_cli_options'; import deepCyclicCopy from './deep_cyclic_copy'; const createDirectory = (path: string) => { @@ -47,5 +46,4 @@ module.exports = { installCommonGlobals, isInteractive, setGlobal, - validateCLIOptions, }; diff --git a/packages/jest-util/src/__tests__/__snapshots__/validate_cli_options.test.js.snap b/packages/jest-validate/src/__tests__/__snapshots__/validate_cli_options.test.js.snap similarity index 100% rename from packages/jest-util/src/__tests__/__snapshots__/validate_cli_options.test.js.snap rename to packages/jest-validate/src/__tests__/__snapshots__/validate_cli_options.test.js.snap diff --git a/packages/jest-util/src/__tests__/validate_cli_options.test.js b/packages/jest-validate/src/__tests__/validate_cli_options.test.js similarity index 100% rename from packages/jest-util/src/__tests__/validate_cli_options.test.js rename to packages/jest-validate/src/__tests__/validate_cli_options.test.js diff --git a/packages/jest-validate/src/index.js b/packages/jest-validate/src/index.js index 91c3f46fdf95..c17c0c3797b1 100644 --- a/packages/jest-validate/src/index.js +++ b/packages/jest-validate/src/index.js @@ -14,6 +14,7 @@ import { ValidationError, } from './utils'; import validate from './validate'; +import validateCLIOptions from './validate_cli_options'; module.exports = { ValidationError, @@ -21,4 +22,5 @@ module.exports = { format, logValidationWarning, validate, + validateCLIOptions, }; diff --git a/packages/jest-util/src/validate_cli_options.js b/packages/jest-validate/src/validate_cli_options.js similarity index 94% rename from packages/jest-util/src/validate_cli_options.js rename to packages/jest-validate/src/validate_cli_options.js index 78551d8fdc41..98cd50e5de24 100644 --- a/packages/jest-util/src/validate_cli_options.js +++ b/packages/jest-validate/src/validate_cli_options.js @@ -10,7 +10,12 @@ import type {Argv} from 'types/Argv'; import chalk from 'chalk'; -import {ValidationError, format, createDidYouMeanMessage} from 'jest-validate'; +import { + createDidYouMeanMessage, + format, + logValidationWarning, + ValidationError, +} from './utils'; const BULLET: string = chalk.bold('\u25cf');