From b19f977058ac34513cdb10b68a72b72894dd43b1 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Sat, 20 Jan 2018 17:36:40 +0100 Subject: [PATCH] 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 --- CHANGELOG.md | 10 ++++++++-- packages/jest/bin/jest.js | 6 +++++- packages/jest/package.json | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) 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": {