Skip to content

Commit 724d2b0

Browse files
authored
build(devs-dep): adopt Jest 28.0.0-alpha.11 (#3449)
1 parent 45ca79e commit 724d2b0

35 files changed

Lines changed: 27327 additions & 14567 deletions

.eslintignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
dist/
2-
node_modules/
3-
coverage/
1+
dist
2+
node_modules
3+
coverage
44
presets/index.d.ts
5+
website/build
6+
website/.docusaurus

e2e/__tests__/__snapshots__/const-enum.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ exports[`partial successfully runs the tests inside const-enum with 'isolatedMod
99
However, Jest was able to find:
1010
'../hoo-constant.d.ts'
1111
12-
You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'jsx', 'ts', 'tsx', 'json', 'node'].
12+
You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'mjs', 'cjs', 'jsx', 'ts', 'tsx', 'json', 'node'].
1313
1414
See https://jestjs.io/docs/configuration#modulefileextensions-arraystring
1515
@@ -19,7 +19,7 @@ exports[`partial successfully runs the tests inside const-enum with 'isolatedMod
1919
3 | const getTwo = (): string => HooConstEnum.two
2020
4 |
2121
22-
at Resolver.resolveModule (../../node_modules/jest-resolve/build/resolver.js:324:11)
22+
at Resolver._throwModNotFoundError (../../node_modules/jest-resolve/build/resolver.js:493:11)
2323
at Object.<anonymous> (__tests__/import-from-d-ts-no-js.spec.ts:1:1)
2424
2525
PASS __tests__/import-from-d-ts-has-js.spec.ts

e2e/__tests__/__snapshots__/enum.test.ts.snap

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`partial successfully runs the tests inside \`enum/\` with \`isolatedModules: false\` 1`] = `
3+
exports[`partial successfully runs the tests inside enum with 'isolatedModules: false' 1`] = `
44
"FAIL __tests__/import-from-d-ts-no-js.spec.ts
55
● Test suite failed to run
66
@@ -9,24 +9,24 @@ exports[`partial successfully runs the tests inside \`enum/\` with \`isolatedMod
99
However, Jest was able to find:
1010
'../hoo-constant.d.ts'
1111
12-
You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'jsx', 'ts', 'tsx', 'json', 'node'].
12+
You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'mjs', 'cjs', 'jsx', 'ts', 'tsx', 'json', 'node'].
1313
1414
See https://jestjs.io/docs/configuration#modulefileextensions-arraystring
1515
16-
> 1 | import { HooEnum } from '../hoo-constant'
16+
> 1 | import { FooEnum } from '../hoo-constant'
1717
| ^
1818
2 |
19-
3 | const getTwo = (): string => HooEnum.two
19+
3 | const getTwo = (): string => FooEnum.two
2020
4 |
2121
22-
at Resolver.resolveModule (../../node_modules/jest-resolve/build/resolver.js:324:11)
22+
at Resolver._throwModNotFoundError (../../node_modules/jest-resolve/build/resolver.js:493:11)
2323
at Object.<anonymous> (__tests__/import-from-d-ts-no-js.spec.ts:1:1)
2424
2525
PASS __tests__/import-from-d-ts-has-js.spec.ts
2626
PASS __tests__/import-from-ts.spec.ts"
2727
`;
2828
29-
exports[`partial successfully runs the tests inside \`enum/\` with \`isolatedModules: true\` 1`] = `
29+
exports[`partial successfully runs the tests inside enum with 'isolatedModules: true' 1`] = `
3030
"FAIL __tests__/import-from-d-ts-no-js.spec.ts
3131
● Test suite failed to run
3232
@@ -35,17 +35,17 @@ exports[`partial successfully runs the tests inside \`enum/\` with \`isolatedMod
3535
However, Jest was able to find:
3636
'../hoo-constant.d.ts'
3737
38-
You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'jsx', 'ts', 'tsx', 'json', 'node'].
38+
You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'mjs', 'cjs', 'jsx', 'ts', 'tsx', 'json', 'node'].
3939
4040
See https://jestjs.io/docs/configuration#modulefileextensions-arraystring
4141
42-
> 1 | import { HooEnum } from '../hoo-constant'
42+
> 1 | import { FooEnum } from '../hoo-constant'
4343
| ^
4444
2 |
45-
3 | const getTwo = (): string => HooEnum.two
45+
3 | const getTwo = (): string => FooEnum.two
4646
4 |
4747
48-
at Resolver.resolveModule (../../node_modules/jest-resolve/build/resolver.js:324:11)
48+
at Resolver._throwModNotFoundError (../../node_modules/jest-resolve/build/resolver.js:493:11)
4949
at Object.<anonymous> (__tests__/import-from-d-ts-no-js.spec.ts:1:1)
5050
5151
PASS __tests__/import-from-d-ts-has-js.spec.ts

e2e/__tests__/enum.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import runJest from '../run-jest'
22
import { extractSortedSummary } from '../utils'
33

4-
const DIR = 'enum'
4+
const DIR_NAME = 'enum'
55

6-
test('partial successfully runs the tests inside `enum/` with `isolatedModules: false`', () => {
7-
const result = runJest(DIR)
6+
test(`partial successfully runs the tests inside ${DIR_NAME} with 'isolatedModules: false'`, () => {
7+
const result = runJest(DIR_NAME)
88

99
expect(extractSortedSummary(result.stderr).rest).toMatchSnapshot()
1010
})
1111

12-
test('partial successfully runs the tests inside `enum/` with `isolatedModules: true`', () => {
13-
const result = runJest(DIR, ['-c=jest-isolated.config.js'])
12+
test(`partial successfully runs the tests inside ${DIR_NAME} with 'isolatedModules: true'`, () => {
13+
const result = runJest(DIR_NAME, ['-c=jest-isolated.config.js'])
1414

1515
expect(extractSortedSummary(result.stderr).rest).toMatchSnapshot()
1616
})

e2e/enum/__tests__/import-from-d-ts-no-js.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { HooEnum } from '../hoo-constant'
1+
import { FooEnum } from '../hoo-constant'
22

3-
const getTwo = (): string => HooEnum.two
3+
const getTwo = (): string => FooEnum.two
44

55
test('should pass', () => {
66
expect(getTwo()).toBe('TWO')

e2e/enum/hoo-constant.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export declare enum HooEnum {
1+
export declare enum FooEnum {
22
two = 'TWO',
33
}

e2e/native-esm-js/__tests__/native-esm.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ test('should have correct import.meta', () => {
2323
expect(typeof require).toBe('undefined')
2424
expect(typeof jest).toBe('undefined')
2525
expect(import.meta).toEqual({
26+
jest: expect.anything(),
2627
url: expect.any(String),
2728
})
29+
// @ts-expect-error `jest` exists in import.meta in Jest 28
30+
expect(import.meta.jest).toBe(jestObject)
2831
expect(import.meta.url.endsWith('/e2e/native-esm-js/__tests__/native-esm.spec.ts')).toBe(true)
2932
})
3033

e2e/native-esm-js/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"compilerOptions": {
33
"target": "ES2017",
4+
"module": "ESNext",
45
"allowJs": true,
56
"checkJs": false,
67
"esModuleInterop": true,

0 commit comments

Comments
 (0)