Skip to content

Commit

Permalink
Convert Jest configuration to TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
jonkoops committed Jul 27, 2023
1 parent 5439c3d commit eff64e2
Show file tree
Hide file tree
Showing 3 changed files with 231 additions and 5 deletions.
13 changes: 8 additions & 5 deletions jest.config.js → jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
export default {
import { type JestConfigWithTsJest } from "ts-jest";

const jestConfig: JestConfigWithTsJest = {
rootDir: "./",
moduleFileExtensions: ["ts", "js"],
testMatch: ["**/test/**/*.test.ts", "**/test/tests.ts"],
coverageProvider: "v8",
coveragePathIgnorePatterns: ["/node_modules/", "./jest.config.js", "./test"],
extensionsToTreatAsEsm: ['.ts'],
coveragePathIgnorePatterns: ["/node_modules/", "./test"],
extensionsToTreatAsEsm: [".ts"],
reporters: [
"default",
["jest-junit", { outputDirectory: "test-results/jest" }],
],
coverageReporters: ["lcov", "text", "text-summary"],
setupFiles: [],
preset: 'ts-jest/presets/default-esm',
preset: "ts-jest/presets/default-esm",
transform: {
"^.+\\.ts?$": [
"ts-jest",
{ useESM: true, tsconfig: "./tsconfig.test.json" },
],
},
};

export default jestConfig;
222 changes: 222 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"rollup-plugin-serve": "^2.0.2",
"rollup-plugin-typescript2": "^0.35.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "^5.1.6"
},
"files": [
Expand Down

0 comments on commit eff64e2

Please sign in to comment.