Skip to content

Commit e2e553f

Browse files
committed
added jest.
1 parent 640909a commit e2e553f

File tree

4 files changed

+260
-9
lines changed

4 files changed

+260
-9
lines changed
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import type {Config} from 'jest';
2-
3-
const config: Config = {
1+
const config = {
42
preset: 'ts-jest',
53
testEnvironment: 'node',
6-
transform: {
7-
".ts": ["ts-jest", { tsconfig: "./tsconfig.jest.json" }]
8-
},
94
roots: ['<rootDir>/src'],
5+
transform: {
6+
'^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.jest.json' }],
7+
},
108
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$',
119
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
10+
moduleNameMapper: {
11+
'\\.(css|less)$': '<rootDir>/node_modules/@patternfly/react-styles/__mocks__/styleMock.js'
12+
},
1213
};
1314

1415
export default config;

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
"preview": "astro preview",
1010
"astro": "astro",
1111
"lint": "eslint . --cache --cache-strategy content",
12-
"test": "echo \"Error: no test specified\"",
13-
"test.jest": "jest",
12+
"test": "jest",
1413
"test:watch": "jest --watch"
1514
},
1615
"dependencies": {
@@ -31,6 +30,7 @@
3130
"@types/node": "^22.9.1",
3231
"globals": "^15.12.0",
3332
"jest": "^29.7.0",
33+
"ts-jest": "^29.2.5",
3434
"ts-node": "^10.9.2",
3535
"typescript-eslint": "^8.15.0"
3636
}

tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"compilerOptions": {
44
"jsx": "react-jsx",
55
"jsxImportSource": "react",
6-
"target": "ES5",
6+
"target": "ES6",
7+
"module": "ESNext",
78
"moduleResolution": "node",
9+
"importHelpers": true,
810
}
911
}

0 commit comments

Comments
 (0)