diff --git a/CHANGELOG.md b/CHANGELOG.md index 271e6ba0cad8..f88c7a836577 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,21 @@ ## master +### Fixes + +* `[jest]` Add `import-local` to `jest` package. + ([#5353](https://github.com/facebook/jest/pull/5353)) + ## jest 22.1.4 ### Fixes * `[jest-util]` Add "debug" method to "console" implementations ([#5350](https://github.com/facebook/jest/pull/5350)) -* `[jest-resolve]` Add condition to avoid infinite loop when node module package main is ".". - ([#5344)](https://github.com/facebook/jest/pull/5344) +* `[jest-resolve]` Add condition to avoid infinite loop when node module package + main is ".". ([#5344)](https://github.com/facebook/jest/pull/5344) ### Features + * `[jest-cli]` `--changedSince`: allow selectively running tests for code changed since arbitrary revisions. ([#5312](https://github.com/facebook/jest/pull/5312)) diff --git a/packages/jest/bin/jest.js b/packages/jest/bin/jest.js index 6b01b1c48ed7..bb9e1ded5c45 100755 --- a/packages/jest/bin/jest.js +++ b/packages/jest/bin/jest.js @@ -6,4 +6,8 @@ * LICENSE file in the root directory of this source tree. */ -require('jest-cli/bin/jest'); +const importLocal = require('import-local'); + +if (!importLocal(__filename)) { + require('jest-cli/bin/jest'); +} diff --git a/packages/jest/package.json b/packages/jest/package.json index 17deb7acb6c9..eae6cf528994 100644 --- a/packages/jest/package.json +++ b/packages/jest/package.json @@ -4,6 +4,7 @@ "version": "22.1.4", "main": "build/jest.js", "dependencies": { + "import-local": "^1.0.0", "jest-cli": "^22.1.4" }, "bin": {