Skip to content

Commit 79a4ff4

Browse files
authored
fix: add ESM exports of all modules manually (#14661)
1 parent f99213d commit 79a4ff4

File tree

58 files changed

+156
-29
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+156
-29
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion

e2e/custom-esm-test-sequencer/testSequencer.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Sequencer from '@jest/test-sequencer';
99

10-
export default class CustomSequencer extends Sequencer.default {
10+
export default class CustomSequencer extends Sequencer {
1111
sort(tests) {
1212
const copyTests = Array.from(tests);
1313
return copyTests.sort((testA, testB) => (testA.path > testB.path ? 1 : -1));

e2e/global-setup-esm/setup.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ import * as crypto from 'crypto';
88
import * as os from 'os';
99
import * as path from 'path';
1010
import fs from 'graceful-fs';
11-
import jestUtil from 'jest-util';
12-
13-
const {createDirectory} = jestUtil;
11+
import {createDirectory} from 'jest-util';
1412

1513
const DIR = path.join(os.tmpdir(), 'jest-global-setup-esm');
1614

e2e/global-teardown-esm/teardown.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ import * as crypto from 'crypto';
88
import * as os from 'os';
99
import * as path from 'path';
1010
import fs from 'graceful-fs';
11-
import jestUtil from 'jest-util';
12-
13-
const {createDirectory} = jestUtil;
11+
import {createDirectory} from 'jest-util';
1412

1513
const DIR = path.join(os.tmpdir(), 'jest-global-teardown-esm');
1614

e2e/transform/transform-esm-runner/runner.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
import testResult from '@jest/test-result';
9-
10-
const {createEmptyTestResult} = testResult;
8+
import {createEmptyTestResult} from '@jest/test-result';
119

1210
export default class BaseTestRunner {
1311
constructor(globalConfig, context) {

e2e/transform/transform-esm-testrunner/test-runner.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*/
7-
import testResult from '@jest/test-result';
87

9-
const {createEmptyTestResult} = testResult;
8+
import {createEmptyTestResult} from '@jest/test-result';
109

1110
export default async function testRunner(
1211
globalConfig,

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
"rimraf": "^5.0.0",
7575
"semver": "^7.5.3",
7676
"slash": "^3.0.0",
77-
"string-length": "^4.0.1",
7877
"strip-ansi": "^6.0.0",
7978
"strip-json-comments": "^3.1.1",
8079
"tempy": "^1.0.0",

packages/babel-jest/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
"exports": {
1414
".": {
1515
"types": "./build/index.d.ts",
16+
"require": "./build/index.js",
17+
"import": "./build/index.mjs",
1618
"default": "./build/index.js"
1719
},
1820
"./package.json": "./package.json"

packages/babel-plugin-jest-hoist/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
"exports": {
1616
".": {
1717
"types": "./build/index.d.ts",
18+
"require": "./build/index.js",
19+
"import": "./build/index.mjs",
1820
"default": "./build/index.js"
1921
},
2022
"./package.json": "./package.json"

packages/create-jest/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
"exports": {
1515
".": {
1616
"types": "./build/index.d.ts",
17+
"require": "./build/index.js",
18+
"import": "./build/index.mjs",
1719
"default": "./build/index.js"
1820
},
1921
"./package.json": "./package.json",

0 commit comments

Comments
 (0)