miaoda-game-devkit 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/react/vitest-config.js +27 -0
- package/dist/react/vitest-config.mjs +27 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,6 +44,10 @@ scheduler、Worker 或未通过浏览器 timer 接入的引擎时,应传显式
|
|
|
44
44
|
并在每个用例后清理;该 Canvas 适配不执行真实绘制,
|
|
45
45
|
也不提供 Canvas/WebGL 像素证明;
|
|
46
46
|
|
|
47
|
+
- React Vitest 统一统计 `src/game/core/` 与 `src/game/runtime/` 的逐文件覆盖率;Core
|
|
48
|
+
使用 50/40 分支基线,Runtime 使用 40/30 分支基线。模板通过 `pnpm test` 启用 V8
|
|
49
|
+
coverage,项目不能覆盖范围或降低阈值;
|
|
50
|
+
|
|
47
51
|
- 支持 DOM 鼠标、键盘和触摸输入的确定性 Phaser 无头测试宿主;
|
|
48
52
|
- 不依赖渲染器的运行时、交互区域和文字健康检查;
|
|
49
53
|
- 只在 devkit 自身 CI 中运行、不会发布到业务项目的通用 Vitest 契约测试;
|
|
@@ -1493,6 +1493,33 @@ function defineReactGameVitestConfig(options) {
|
|
|
1493
1493
|
} : {},
|
|
1494
1494
|
restoreMocks: true,
|
|
1495
1495
|
clearMocks: true,
|
|
1496
|
+
coverage: {
|
|
1497
|
+
provider: "v8",
|
|
1498
|
+
include: [
|
|
1499
|
+
"src/game/core/**/*.{ts,tsx}",
|
|
1500
|
+
"src/game/runtime/**/*.{ts,tsx}"
|
|
1501
|
+
],
|
|
1502
|
+
exclude: [
|
|
1503
|
+
"src/game/{core,runtime}/**/*.d.ts",
|
|
1504
|
+
"src/game/{core,runtime}/**/*.{spec,test}.{ts,tsx}"
|
|
1505
|
+
],
|
|
1506
|
+
reporter: ["text-summary"],
|
|
1507
|
+
thresholds: {
|
|
1508
|
+
perFile: true,
|
|
1509
|
+
"src/game/core/**/*.{ts,tsx}": {
|
|
1510
|
+
lines: 50,
|
|
1511
|
+
functions: 50,
|
|
1512
|
+
statements: 50,
|
|
1513
|
+
branches: 40
|
|
1514
|
+
},
|
|
1515
|
+
"src/game/runtime/**/*.{ts,tsx}": {
|
|
1516
|
+
lines: 40,
|
|
1517
|
+
functions: 40,
|
|
1518
|
+
statements: 40,
|
|
1519
|
+
branches: 30
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
},
|
|
1496
1523
|
testTimeout: options.testTimeout,
|
|
1497
1524
|
hookTimeout: options.hookTimeout
|
|
1498
1525
|
}
|
|
@@ -1459,6 +1459,33 @@ function defineReactGameVitestConfig(options) {
|
|
|
1459
1459
|
} : {},
|
|
1460
1460
|
restoreMocks: true,
|
|
1461
1461
|
clearMocks: true,
|
|
1462
|
+
coverage: {
|
|
1463
|
+
provider: "v8",
|
|
1464
|
+
include: [
|
|
1465
|
+
"src/game/core/**/*.{ts,tsx}",
|
|
1466
|
+
"src/game/runtime/**/*.{ts,tsx}"
|
|
1467
|
+
],
|
|
1468
|
+
exclude: [
|
|
1469
|
+
"src/game/{core,runtime}/**/*.d.ts",
|
|
1470
|
+
"src/game/{core,runtime}/**/*.{spec,test}.{ts,tsx}"
|
|
1471
|
+
],
|
|
1472
|
+
reporter: ["text-summary"],
|
|
1473
|
+
thresholds: {
|
|
1474
|
+
perFile: true,
|
|
1475
|
+
"src/game/core/**/*.{ts,tsx}": {
|
|
1476
|
+
lines: 50,
|
|
1477
|
+
functions: 50,
|
|
1478
|
+
statements: 50,
|
|
1479
|
+
branches: 40
|
|
1480
|
+
},
|
|
1481
|
+
"src/game/runtime/**/*.{ts,tsx}": {
|
|
1482
|
+
lines: 40,
|
|
1483
|
+
functions: 40,
|
|
1484
|
+
statements: 40,
|
|
1485
|
+
branches: 30
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
},
|
|
1462
1489
|
testTimeout: options.testTimeout,
|
|
1463
1490
|
hookTimeout: options.hookTimeout
|
|
1464
1491
|
}
|