Skip to content

Commit c735e1b

Browse files
committed
it's working?
1 parent 7322aa8 commit c735e1b

File tree

7 files changed

+3388
-106
lines changed

7 files changed

+3388
-106
lines changed

photon-client/jest.config.cjs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/** @type {import('jest').Config} */
2+
module.exports = {
3+
preset: "ts-jest/presets/default-esm",
4+
testEnvironment: "jsdom",
5+
roots: ["<rootDir>/unit"],
6+
testMatch: ["**/__tests__/**/*.ts?(x)", "**/?(*.)+(spec|test).ts?(x)"],
7+
extensionsToTreatAsEsm: [".ts", ".tsx"],
8+
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node", "vue"],
9+
moduleNameMapper: {
10+
"^@/(.*)$": "<rootDir>/src/$1",
11+
"\\.(css|less|scss|sass)$": "identity-obj-proxy"
12+
},
13+
transform: {
14+
"^.+\\.vue$": "@vue/vue3-jest",
15+
".+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$": "jest-transform-stub",
16+
"^.+\\.tsx?$": [
17+
"ts-jest",
18+
{
19+
useESM: true,
20+
tsconfig: {
21+
module: "ESNext",
22+
verbatimModuleSyntax: false
23+
}
24+
}
25+
]
26+
},
27+
transformIgnorePatterns: ["/node_modules/"],
28+
collectCoverageFrom: ["src/**/*.{js,ts,vue}", "!src/**/*.d.ts", "!src/main.ts", "!src/index.ts"],
29+
testPathIgnorePatterns: ["/node_modules/", "/dist/", "/build/"]
30+
};

photon-client/jest.config.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

photon-client/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"test": "playwright test",
1616
"test-ui": "playwright test --ui",
1717
"test-setup": "playwright install --with-deps",
18-
"test:unit": "jest",
19-
"test:unit:watch": "jest --watch"
18+
"test:unit": "jest --config jest.config.cjs",
19+
"test:unit:watch": "jest --config jest.config.cjs --watch"
2020

2121
},
2222
"dependencies": {
@@ -41,17 +41,21 @@
4141
"@types/node": "^22.15.14",
4242
"@types/three": "^0.178.0",
4343
"@vitejs/plugin-vue": "^6.0.0",
44+
"@vue/vue3-jest": "^29.2.6",
4445
"@vue/eslint-config-prettier": "^10.2.0",
4546
"@vue/eslint-config-typescript": "^14.5.0",
4647
"@vue/test-utils": "^2.4.3",
4748
"@vue/tsconfig": "^0.7.0",
4849
"eslint": "^9.31.0",
4950
"eslint-plugin-vue": "^10.3.0",
51+
"identity-obj-proxy": "^3.0.0",
5052
"jest": "^29.7.0",
5153
"jest-environment-jsdom": "^29.7.0",
54+
"jest-transform-stub": "^2.0.0",
5255
"prettier": "^3.6.2",
5356
"sass": "^1.89.2",
5457
"ts-jest": "^29.1.1",
58+
"ts-node": "^10.9.2",
5559
"typescript": "^5.8.3",
5660
"vite": "^7.0.5",
5761
"vite-plugin-vuetify": "^2.1.1"

0 commit comments

Comments
 (0)