Skip to content

Commit aa36a9a

Browse files
authored
chore: actually fix types in the Jest config (#1175)
1 parent 8b4aaf5 commit aa36a9a

File tree

8 files changed

+41
-30
lines changed

8 files changed

+41
-30
lines changed

packages/library/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
"eslint-plugin-jest": "^27.1.5",
7575
"eslint-plugin-react-hooks": "^4.6.0",
7676
"eslint-plugin-sort-keys-fix": "^1.1.2",
77-
"jest": "^29.3.1",
78-
"jest-environment-jsdom": "^29.3.1",
77+
"jest": "^29.4.2",
78+
"jest-environment-jsdom": "^29.4.2",
7979
"jest-runner-eslint": "^1.1.0",
8080
"jest-runner-prettier": "^1.0.0",
8181
"postcss": "^8.4.12",

packages/test-config/jest-lint.config.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import type { Config } from 'jest';
1+
import type { Config } from '@jest/types';
22

3-
const config: NonNullable<Config['projects']>[number] = {
4-
displayName: 'ESLint',
3+
const config: Partial<Config.ProjectConfig> = {
4+
displayName: {
5+
color: 'cyanBright',
6+
name: 'ESLint',
7+
},
58
runner: 'eslint',
69
testMatch: ['<rootDir>src/**/*.ts'],
710
};

packages/test-config/jest-prettier.config.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import type { Config } from 'jest';
1+
import type { Config } from '@jest/types';
22

3-
const config: NonNullable<Config['projects']>[number] = {
4-
displayName: 'Prettier',
3+
const config: Partial<Config.ProjectConfig> = {
4+
displayName: {
5+
color: 'magentaBright',
6+
name: 'Prettier',
7+
},
58
moduleFileExtensions: ['js', 'ts', 'json', 'md'],
69
runner: 'prettier',
710
testMatch: ['<rootDir>/src/**', '<rootDir>*'],

packages/test-config/jest-unit.config.browser.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
import type { Config } from 'jest';
1+
import type { Config } from '@jest/types';
22
import commonConfig from './jest-unit.config.common';
33

4-
const config: NonNullable<Config['projects']>[number] = {
4+
const config: Partial<Config.ProjectConfig> = {
55
...commonConfig,
6-
displayName: 'Unit Test (Browser)',
6+
displayName: {
7+
color: 'grey',
8+
name: 'Unit Test (Browser)',
9+
},
710
globals: {
811
...commonConfig.globals,
912
__BROWSER__: true,

packages/test-config/jest-unit.config.common.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
import type { Config } from 'jest';
1+
import { Config } from '@jest/types';
22

3-
const config: NonNullable<Config['projects']>[number] = {
3+
const config: Partial<Config.ProjectConfig> = {
44
globals: {
55
__DEV__: false,
66
},
77
roots: ['<rootDir>/src/'],
88
transform: {
9+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
10+
// @ts-expect-error See https://github.com/facebook/jest/issues/13913
911
'^.+\\.(ts|js)$': [
1012
'@swc/jest',
1113
{

packages/test-config/jest-unit.config.node.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
import { Config } from 'jest';
1+
import { Config } from '@jest/types';
22
import commonConfig from './jest-unit.config.common';
33

4-
const config: NonNullable<Config['projects']>[number] = {
4+
const config: Partial<Config.ProjectConfig> = {
55
...commonConfig,
6-
displayName: 'Unit Test (Node)',
6+
displayName: {
7+
color: 'grey',
8+
name: 'Unit Test (Node)',
9+
},
710
globals: {
811
...commonConfig.globals,
912
__BROWSER__: false,

packages/test-config/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,17 @@
1010
"jest-unit.config.node.ts"
1111
],
1212
"peerDependencies": {
13-
"jest": "^29.3.1",
14-
"jest-environment-jsdom": "^29.3.1",
13+
"jest": "^29.4.2",
14+
"jest-environment-jsdom": "^29.4.2",
1515
"jest-runner-eslint": "^1.1.0",
1616
"jest-runner-prettier": "^1.0.0",
1717
"jest-watch-master": "^1.0.0",
1818
"jest-watch-select-projects": "^2.0.0",
1919
"jest-watch-typeahead": "^2.2.2"
2020
},
2121
"devDependencies": {
22-
"jest": "^29.3.1",
22+
"@jest/types": "^29.4.2",
23+
"jest": "^29.4.2",
2324
"tsconfig": "workspace:*"
2425
}
2526
}

pnpm-lock.yaml

Lines changed: 7 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)