-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathjest.config.js
More file actions
26 lines (23 loc) · 837 Bytes
/
jest.config.js
File metadata and controls
26 lines (23 loc) · 837 Bytes
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
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html
/* eslint-disable @typescript-eslint/no-var-requires */
const { pathsToModuleNameMapper } = require("ts-jest");
const { compilerOptions } = require("./tsconfig.json");
module.exports = {
preset: "ts-jest",
// The glob patterns Jest uses to detect test files
testMatch: ["**/__tests__/*.+(ts|tsx|js)", "**/*.test.ts"],
// An array of file extensions your modules use
moduleFileExtensions: ["ts", "tsx", "js", "yaml"],
transform: {
// ... other transforms ...
"\\.yaml$": "jest-transform-yaml",
"^.+.tsx?$": [
"ts-jest",
{
tsconfig: compilerOptions,
},
],
},
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: "<rootDir>/" }),
};