diff --git a/biome.json b/biome.json index 9623dda..a025314 100644 --- a/biome.json +++ b/biome.json @@ -4,7 +4,7 @@ "enabled": true }, "files": { - "ignore": ["main.js"] + "ignore": ["main.js", "*.main.js", "coverage/**", "node_modules/**"] }, "formatter": { "enabled": true, diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index e36d9ea..ee7e3ce 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -52,5 +52,16 @@ Citar o PR upstream na mensagem de commit (`baseado no PR upstream #`). ## Testes - Toda feature ou bugfix inclui teste -- Cobertura mínima do core: a definir (atualmente sem threshold) - Localização: `tests/` para src/, `pro/tests/` para pro/ +- Comando: `npm run test:coverage` + +### Política de cobertura (ratchet) + +Cobertura mínima de linhas é um **piso que só sobe**. Atualmente em `8%` +(via `c8 --check-coverage --lines=8` no script `test:coverage`). + +Quando você adicionar testes que elevam a cobertura geral, **suba o piso** +no script `test:coverage` para o novo valor (truncado). Nunca abaixar. + +Meta de longo prazo: 70% (padrão code-standards). Áreas zero-cobertura +prioritárias: `src/main.ts`, `src/settings.ts`, backends `fs*.ts`. diff --git a/package.json b/package.json index 0b220dc..f299eb0 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "format": "npx @biomejs/biome check --write .", "clean": "npx rimraf main.js", "test": "mocha --import=tsx 'tests/**/*.ts' 'pro/tests/**/*.ts'", - "test:coverage": "c8 --reporter=text --reporter=lcov --reporter=html npm test" + "test:coverage": "c8 --check-coverage --lines=8 --reporter=text --reporter=lcov --reporter=html npm test" }, "browser": { "path": "path-browserify",