forked from dwmkerr/terminal-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.ts
More file actions
58 lines (46 loc) · 1.72 KB
/
jest.config.ts
File metadata and controls
58 lines (46 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import type { Config } from "jest";
/*
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/configuration
*/
const config: Config = {
// We're using ts-jest for typescript support. Treat *.ts files as ESM
// modules so that we can use 'import'.
// See:
// https://kulshekhar.github.io/ts-jest/docs/next/guides/esm-support/
preset: "ts-jest",
extensionsToTreatAsEsm: [".ts"],
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
},
transform: {
// '^.+\\.[tj]sx?$' to process js/ts with `ts-jest`
// '^.+\\.m?[tj]sx?$' to process js/ts/mjs/mts with `ts-jest`
"^.+\\.tsx?$": [
"ts-jest",
{
useESM: true,
},
],
},
// Only look for tests in the src folder, i.e. excluded build.
roots: ["./src/"],
// Jest setup function.
setupFilesAfterEnv: ["./src/jest/jest.setup.ts"],
// Automatically clear mock calls, instances, contexts and results before every test
clearMocks: true,
// Indicates whether the coverage information should be collected while executing the test
collectCoverage: true,
collectCoverageFrom: ["src/**/*.{js,ts}"],
// The directory where Jest should output its coverage files
coverageDirectory: "artifacts/coverage",
// Indicates which provider should be used to instrument code for coverage
coverageProvider: "v8",
// The types of coverage reporters to use.
coverageReporters: ["text", "cobertura", "html"],
// A list of paths to modules that run some code to configure or set up the testing framework before each test
// setupFilesAfterEnv: ["./src/setup-jest.js"],
// The test environment that will be used for testing
testEnvironment: "node",
};
export default config;