Skip to content

Commit e8aae22

Browse files
committed
feat(tests): add complete test suite with unit, integration, E2E and mutation testing
- Add Vitest unit tests: getPattern (70), presets with Zod oracle (21), helpers (11) - Add Vitest integration tests: banner.js (27), localStorage (16) - Add Playwright E2E tests: banner customization, accessibility (axe-core WCAG 2.1 AA), performance - Add Stryker mutation testing config for presets.js and helpers.js - Add ESLint + eslint-plugin-security for static analysis (OWASP Top 10) - Add @faker-js/faker for test data generation - Add Zod schemas as validation oracles (PresetSchema, ThemeSchema, PatternResultSchema) - Add vitest.config.js with jsdom environment and coverage thresholds (lines>=70%, functions>=80%) - Add playwright.config.ts with 4 browsers (chromium, firefox, webkit, mobile-chrome) - Add TESTING.md with full technical documentation of the test suite - Add trabajo.md with project presentation and analysis - Update package.json: add type:module + all testing devDependencies + npm scripts Coverage achieved: 74% lines, 72% branches, 100% functions Bugs found: 7 (including 1 critical TypeError in banner.js) E2E results: 29/34 pass, 5 fail (real production bugs - accessibility violations WCAG 2.1)
1 parent d497d26 commit e8aae22

21 files changed

Lines changed: 12653 additions & 1421 deletions

TESTING.md

Lines changed: 439 additions & 0 deletions
Large diffs are not rendered by default.

eslint.config.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import js from "@eslint/js";
2+
import security from "eslint-plugin-security";
3+
4+
export default [
5+
js.configs.recommended,
6+
{
7+
plugins: { security },
8+
rules: {
9+
...security.configs.recommended.rules,
10+
"no-eval": "error",
11+
"no-implied-eval": "error",
12+
"no-new-func": "error",
13+
"no-script-url": "error",
14+
"no-unused-vars": "warn",
15+
"no-console": "off",
16+
},
17+
files: ["js/**/*.js"],
18+
ignores: ["js/data/patterns.js"],
19+
},
20+
];

0 commit comments

Comments
 (0)