test(seo): expand structured data tests to cover all 7 schema components
- Add 24 new tests for ServiceSchema, ProductSchema, FAQSchema, BreadcrumbSchema, and LocalBusinessSchema (previously uncovered) - Raise SEO component coverage from 40.89% → 100% (all metrics) - Update jest.config.js coverage thresholds to reflect Phase 7实测 values - Sync test-strategy-plan.md to v1.8 with latest coverage data - Update README.md progress with 1509 tests / 73.59% stmts / 82.38% branches
This commit is contained in:
+39
-30
@@ -1,3 +1,4 @@
|
||||
// @ts-nocheck
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
@@ -14,22 +15,24 @@ module.exports = {
|
||||
'src/components/detail/**/*.{ts,tsx}',
|
||||
'src/components/sections/**/*.{ts,tsx}',
|
||||
'src/components/content/**/*.{ts,tsx}',
|
||||
'src/components/analytics/**/*.{ts,tsx}',
|
||||
'src/hooks/**/*.{ts,tsx}',
|
||||
'src/lib/**/*.ts',
|
||||
'!src/**/*.d.ts',
|
||||
'!src/**/*.stories.{ts,tsx}',
|
||||
'!src/**/__tests__/**',
|
||||
],
|
||||
// 覆盖率阈值采用渐进提升策略:基于 Phase 1-5 实测值设定目录级阈值,避免全局平均掩盖核心模块缺口
|
||||
// 实测基准 (Phase 5): global(~33% stmts/~32% branches), hooks(~61%/~41%), lib(~45%/~43%),
|
||||
// ui(~15%/~21%), layout(~59%/~48%), detail(~32%/~29%), sections(~31%/~35%), content(~29%/~5%),
|
||||
// lib/cms(~67%/~83%), lib/constants(~94%/~81%)
|
||||
// 覆盖率阈值采用渐进提升策略:基于 Phase 7 实测值设定目录级阈值,避免全局平均掩盖核心模块缺口
|
||||
// 实测基准 (Phase 7 — 2026-08-02): global(72.65% stmts/82.20% branches/73.56% funcs),
|
||||
// ui(63.91%/76.52%), layout(71.02%/76.92%), detail(74.20%/75.96%), sections(43.24%/78.09%),
|
||||
// seo(100%/100%), content(56.15%/100%), analytics(已覆盖全部 7 组件),
|
||||
// lib(95.96%/89.60%), lib/cms(91.22%/90.90%), lib/constants(98.78%/91.89%)
|
||||
coverageThreshold: {
|
||||
global: {
|
||||
branches: 30,
|
||||
functions: 25,
|
||||
lines: 32,
|
||||
statements: 30,
|
||||
branches: 70,
|
||||
functions: 55,
|
||||
lines: 55,
|
||||
statements: 55,
|
||||
},
|
||||
'./src/hooks/': {
|
||||
branches: 38,
|
||||
@@ -44,40 +47,46 @@ module.exports = {
|
||||
statements: 42,
|
||||
},
|
||||
'./src/components/ui/': {
|
||||
branches: 18,
|
||||
functions: 10,
|
||||
lines: 15,
|
||||
statements: 14,
|
||||
branches: 45,
|
||||
functions: 55,
|
||||
lines: 35,
|
||||
statements: 35,
|
||||
},
|
||||
'./src/components/layout/': {
|
||||
branches: 45,
|
||||
branches: 60,
|
||||
functions: 35,
|
||||
lines: 60,
|
||||
statements: 55,
|
||||
statements: 60,
|
||||
},
|
||||
'./src/components/detail/': {
|
||||
branches: 25,
|
||||
functions: 22,
|
||||
lines: 30,
|
||||
statements: 30,
|
||||
branches: 60,
|
||||
functions: 45,
|
||||
lines: 60,
|
||||
statements: 60,
|
||||
},
|
||||
'./src/components/sections/': {
|
||||
branches: 30,
|
||||
functions: 18,
|
||||
lines: 30,
|
||||
statements: 30,
|
||||
branches: 60,
|
||||
functions: 30,
|
||||
lines: 35,
|
||||
statements: 35,
|
||||
},
|
||||
'./src/components/content/': {
|
||||
branches: 4,
|
||||
functions: 4,
|
||||
lines: 25,
|
||||
statements: 25,
|
||||
branches: 80,
|
||||
functions: 40,
|
||||
lines: 45,
|
||||
statements: 45,
|
||||
},
|
||||
'./src/components/analytics/': {
|
||||
branches: 30,
|
||||
functions: 40,
|
||||
lines: 35,
|
||||
statements: 35,
|
||||
},
|
||||
'./src/components/seo/': {
|
||||
branches: 0,
|
||||
functions: 18,
|
||||
lines: 40,
|
||||
statements: 40,
|
||||
branches: 80,
|
||||
functions: 80,
|
||||
lines: 80,
|
||||
statements: 80,
|
||||
},
|
||||
'./src/lib/cms/': {
|
||||
branches: 80,
|
||||
|
||||
Reference in New Issue
Block a user