Skip to content

Commit b19f977

Browse files
SimenBcpojer
authored andcommitted
fix(jest): import-local should be used in main jest pakage (#5353)
* fix(jest): `import-local` should be used in main jest pakage * docs: update changelog * Update CHANGELOG.md
1 parent 4da1417 commit b19f977

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
## master
22

3+
### Fixes
4+
5+
* `[jest]` Add `import-local` to `jest` package.
6+
([#5353](https://github.com/facebook/jest/pull/5353))
7+
38
## jest 22.1.4
49

510
### Fixes
611

712
* `[jest-util]` Add "debug" method to "console" implementations
813
([#5350](https://github.com/facebook/jest/pull/5350))
9-
* `[jest-resolve]` Add condition to avoid infinite loop when node module package main is ".".
10-
([#5344)](https://github.com/facebook/jest/pull/5344)
14+
* `[jest-resolve]` Add condition to avoid infinite loop when node module package
15+
main is ".". ([#5344)](https://github.com/facebook/jest/pull/5344)
1116

1217
### Features
18+
1319
* `[jest-cli]` `--changedSince`: allow selectively running tests for code
1420
changed since arbitrary revisions.
1521
([#5312](https://github.com/facebook/jest/pull/5312))

packages/jest/bin/jest.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9-
require('jest-cli/bin/jest');
9+
const importLocal = require('import-local');
10+
11+
if (!importLocal(__filename)) {
12+
require('jest-cli/bin/jest');
13+
}

packages/jest/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"version": "22.1.4",
55
"main": "build/jest.js",
66
"dependencies": {
7+
"import-local": "^1.0.0",
78
"jest-cli": "^22.1.4"
89
},
910
"bin": {

0 commit comments

Comments
 (0)