-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathjest.config.ts
More file actions
47 lines (44 loc) · 1.1 KB
/
jest.config.ts
File metadata and controls
47 lines (44 loc) · 1.1 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
import type { JestConfigWithTsJest } from "ts-jest";
const sdkProject = (sdkName: string, overrides: JestConfigWithTsJest) => ({
displayName: `uix-${sdkName}`,
testMatch: [`<rootDir>/packages/uix-${sdkName}/src/**/*.test.ts`],
modulePathIgnorePatterns: ["<rootDir>/dist"],
testEnvironment: "jsdom",
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
useESM: true,
},
],
},
globals: {
UIX_SDK_VERSION: "0.0.999",
UIX_SDK_BUILDMODE: "test",
},
...overrides,
});
const jestConfig = {
extensionsToTreatAsEsm: [".ts", ".tsx"],
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
},
projects: [
sdkProject("core", {
setupFiles: [
"<rootDir>/packages/uix-core/src/__helpers__/jest.messagechannel.cjs",
],
}),
sdkProject("host", {}),
sdkProject("host-react", {
testMatch: [
"<rootDir>/packages/uix-host-react/src/**/*.test.ts",
"<rootDir>/packages/uix-host-react/src/**/*.test.tsx",
],
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
},
}),
],
};
export default jestConfig;