Skip to content

Commit

Permalink
Fix jest setup
Browse files Browse the repository at this point in the history
  • Loading branch information
malte-laukoetter committed Nov 21, 2023
1 parent 9602d47 commit c3a7d9b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 6 additions & 5 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import type { Config } from "@jest/types";

const config: Config.InitialOptions = {
moduleFileExtensions: ["js", "ts", "json"],
transform: {
"^.+\\.ts$": "ts-jest",
},
preset: "ts-jest",
testEnvironment: "jsdom",
moduleDirectories: ["node_modules", "<rootDir>/app"],
moduleNameMapper: {
"~/(.*)": "<rootDir>/app/$1",
},
testPathIgnorePatterns: ["<rootDir>/tests/e2e"],
setupFilesAfterEnv: ["<rootDir>/tests/jest.setup.ts"],
collectCoverageFrom: ["src/**", "!**/*.d.ts"],
collectCoverageFrom: ["app/**/*.{ts,tsx,js,jsx}", "!**/*.d.ts"],
};

export default config;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"typecheck": "tsc",
"test": "jest test",
"test:e2e": "playwright test",
"test:generate-coverage": "jest --coverage",
"lint:check": "eslint --ext .js,.ts --ignore-path .gitignore .",
"lint:fix": "npm run lint:check -- --fix",
"format:check": "prettier --check .",
Expand Down

0 comments on commit c3a7d9b

Please sign in to comment.