Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gpbl committed Dec 10, 2024
2 parents ab8347a + 121814a commit 356f152
Show file tree
Hide file tree
Showing 3 changed files with 326 additions and 374 deletions.
21 changes: 19 additions & 2 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { Config } from "@jest/types";

const config: Config.InitialOptions = {
preset: "ts-jest",
roots: ["./src", "./examples"],
moduleNameMapper: {
"@/test/(.*)": ["<rootDir>/test/$1"],
Expand All @@ -12,7 +11,25 @@ const config: Config.InitialOptions = {
testEnvironment: "jsdom",
coverageReporters: ["lcov", "text", "clover"],
setupFilesAfterEnv: ["./test/setup.ts"],
fakeTimers: { enableGlobally: true }
fakeTimers: { enableGlobally: true },
/**
* Configuration for transforming source files before testing Uses @swc/jest
* to quickly transform JavaScript/TypeScript files
*/
transform: {
"^.+\\.(t|j)sx?$": [
"@swc/jest",
{
jsc: {
transform: {
react: {
runtime: "automatic"
}
}
}
}
]
}
};

export default config;
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@
},
"devDependencies": {
"@jest/types": "^29.6.3",
"@swc/core": "^1.10.1",
"@swc/jest": "^0.2.37",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.0.1",
Expand Down Expand Up @@ -208,7 +210,6 @@
"prettier-plugin-jsdoc": "^1.3.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"tslib": "^2.8.1",
"typescript": "~5.6.3",
Expand Down
Loading

0 comments on commit 356f152

Please sign in to comment.