-
Notifications
You must be signed in to change notification settings - Fork 10
/
jest.config.cjs
38 lines (36 loc) · 1.03 KB
/
jest.config.cjs
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
/* eslint-disable no-undef */
/* eslint-disable import/unambiguous */
/* eslint-disable import/no-commonjs */
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
// because we run tests from within ./packages/<package_name>/
rootDir: "./../../",
moduleDirectories: ["node_modules", "packages"],
extensionsToTreatAsEsm: [".ts"],
moduleNameMapper: {
"o1js/dist/(.*)": "<rootDir>/node_modules/o1js/dist/$1",
"../../../node_modules/o1js/dist/(.*)":
"<rootDir>/node_modules/o1js/dist/$1",
"../../../../node_modules/o1js/dist/(.*)":
"<rootDir>/node_modules/o1js/dist/$1",
"^(\\.{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`
"^.+\\.ts?$": [
"ts-jest",
{
useESM: true,
tsconfig: "./test/tsconfig.json",
},
],
"^.+\\.tsx?$": [
"ts-jest",
{
useESM: true,
tsconfig: "./test/tsconfig.json",
},
],
},
};