chore(test): add test infrastructure, CI config, and security scanning

- Add Jenkinsfile with E2E/visual regression/security scan stages
- Add Stryker mutation testing configuration
- Add security header scanning script (check-security-headers.ts)
- Remove old playwright.config.ts (migrated to e2e/playwright.config.ts)
- Remove obsolete .claude/skills/impeccable
- Update jest config for test path patterns
- Update package.json with comprehensive test scripts
- Update .gitignore for stryker-tmp/ and .pi/ temp files
This commit is contained in:
2026-07-31 20:24:01 +08:00
parent f0b3a44f66
commit dd088a5ee1
12 changed files with 1945 additions and 306 deletions
+14 -1
View File
@@ -19,7 +19,6 @@
"test:coverage:check": "jest --coverage --ci",
"coverage:report": "open coverage/lcov-report/index.html",
"test:e2e": "cd e2e && npx playwright test --config=playwright.config.ts",
"test:smoke": "cd e2e && npx playwright test --grep @smoke",
"test:visual": "cd e2e && npx playwright test visual-regression.spec.ts --project=visual-chromium-desktop",
"test:visual:all": "cd e2e && npx playwright test visual-regression.spec.ts",
"test:visual:update": "cd e2e && npx playwright test visual-regression.spec.ts --project=visual-chromium-desktop --update-snapshots",
@@ -28,8 +27,19 @@
"test:visual:browsers": "cd e2e && npx playwright test visual-regression.spec.ts --project=visual-chromium-desktop --project=visual-firefox-desktop --project=visual-webkit-desktop",
"test:performance": "k6 run tests/performance/load-test.js",
"test:stress": "k6 run tests/performance/stress-test.js",
"test:smoke": "cd e2e && npx playwright test --grep @smoke",
"test:critical": "cd e2e && npx playwright test --grep @critical",
"test:e2e:fast": "cd e2e && npx playwright test --grep '@smoke|@critical'",
"test:e2e:standard": "cd e2e && npx playwright test --grep @regression",
"test:e2e:journey": "cd e2e && npx playwright test --grep @journey",
"test:e2e:mobile": "cd e2e && npx playwright test --grep @mobile",
"test:mutation": "rm -rf .stryker-tmp && npx stryker run --inPlace",
"test:mutation:quick": "rm -rf .stryker-tmp && npx stryker run --inPlace --mutate 'src/lib/utils.ts'",
"test:all": "npm run type-check && npm run lint && npm run test:coverage && npm run test:e2e:fast && npm run test:security:headers",
"check:contrast": "tsx scripts/utils/check-color-contrast.ts",
"check:headings": "tsx scripts/utils/check-heading-hierarchy.ts",
"test:security": "npm audit --audit-level=high && npm run test:security:headers",
"test:security:headers": "tsx scripts/utils/check-security-headers.ts",
"lighthouse": "lhci autorun",
"lighthouse:collect": "lhci collect",
"lighthouse:assert": "lhci assert",
@@ -98,6 +108,8 @@
"@commitlint/config-conventional": "^20.5.0",
"@eslint/eslintrc": "^3.3.5",
"@lhci/cli": "^0.15.1",
"@stryker-mutator/core": "^9.6.1",
"@stryker-mutator/jest-runner": "^9.6.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
@@ -109,6 +121,7 @@
"@types/react-dom": "^18",
"@typescript-eslint/eslint-plugin": "^8.65.0",
"@typescript-eslint/parser": "^8.65.0",
"allure-playwright": "^3.10.2",
"autoprefixer": "^10.4.20",
"chrome-launcher": "^1.2.1",
"eslint": "^9.25.1",