Skip to content

Commit f620a4c

Browse files
committed
Warn on Deprecated Options in CLI args
1 parent a66b88f commit f620a4c

File tree

11 files changed

+79
-10
lines changed

11 files changed

+79
-10
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
### Features
1010
* `[docs]` Add MongoDB guide ([#5571](https://github.com/facebook/jest/pull/5571))
11+
* `[jest-validate]` Add ability to log deprecation warnings for CLI flags.
12+
([#5536](https://github.com/facebook/jest/pull/5536))
1113

1214
## jest 22.3.0
1315

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @flow
8+
*/
9+
10+
'use strict';
11+
12+
const path = require('path');
13+
const runJest = require('../runJest');
14+
15+
const dir = path.resolve(__dirname, '../deprecated-cli-options');
16+
17+
it('Prints deprecation warnings for CLI flags', () => {
18+
const {stderr, stdout, status} = runJest(dir);
19+
expect(status).toBe(0);
20+
expect(stderr).toMatch(/Test Suites: 1 passed, 1 total/);
21+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
test('Dummy', () => {
2+
expect(2).toBe(2);
3+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"jest": {}
3+
}

packages/jest-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"jest-runtime": "^22.3.0",
2828
"jest-snapshot": "^22.2.0",
2929
"jest-util": "^22.3.0",
30-
"jest-validate": "^22.3.0",
30+
"jest-validate": "^22.2.2",
3131
"jest-worker": "^22.2.2",
3232
"micromatch": "^2.3.11",
3333
"node-notifier": "^5.2.1",

packages/jest-config/src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import readConfigFileAndSetRootDir from './read_config_file_and_set_root_dir';
2323

2424
export {getTestEnvironment, isJSONString} from './utils';
2525
export {default as normalize} from './normalize';
26+
export {default as deprecationEntries} from './deprecated';
2627

2728
export function readConfig(
2829
argv: Argv,

packages/jest-repl/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"main": "build/index.js",
1010
"dependencies": {
1111
"jest-runtime": "^22.3.0",
12-
"jest-validate": "^22.3.0",
12+
"jest-validate": "^22.2.2",
1313
"repl": "^0.1.3",
1414
"yargs": "^10.0.3"
1515
},

packages/jest-runtime/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"jest-regex-util": "^22.1.0",
2121
"jest-resolve": "^22.3.0",
2222
"jest-util": "^22.3.0",
23-
"jest-validate": "^22.3.0",
23+
"jest-validate": "^22.2.2",
2424
"json-stable-stringify": "^1.0.1",
2525
"micromatch": "^2.3.11",
2626
"realpath-native": "^1.0.0",

packages/jest-util/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"graceful-fs": "^4.1.11",
1414
"is-ci": "^1.0.10",
1515
"jest-message-util": "^22.2.0",
16-
"jest-validate": "^22.2.2",
1716
"mkdirp": "^0.5.1"
1817
},
1918
"devDependencies": {

packages/jest-validate/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"main": "build/index.js",
1010
"dependencies": {
1111
"chalk": "^2.0.1",
12+
"jest-config": "^22.2.2",
1213
"jest-get-type": "^22.1.0",
1314
"leven": "^2.1.0",
1415
"pretty-format": "^22.1.0"

0 commit comments

Comments
 (0)