|
| 1 | +# Changelog |
| 2 | + |
| 3 | +All notable changes to assert-guard are documented here. |
| 4 | + |
| 5 | +This project follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) |
| 6 | +and [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
| 7 | + |
| 8 | +--- |
| 9 | + |
| 10 | +## [Unreleased] |
| 11 | + |
| 12 | +_Nothing yet._ |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +## [1.0.0] — 2026-04-15 |
| 17 | + |
| 18 | +### Added |
| 19 | + |
| 20 | +- **Core rule engine** — AST-based scanner using `@babel/parser` with TypeScript and JSX support |
| 21 | +- **7 built-in rules** covering the most common test anti-patterns: |
| 22 | + - `no-hard-waits` (error) — flags `cy.wait(N)`, `Thread.sleep()`, `page.waitForTimeout()` |
| 23 | + - `no-logic-in-tests` (error) — detects `if/else`, `for` loops, and `try/catch` inside test blocks |
| 24 | + - `no-focused-tests` (error) — catches `it.only()`, `test.only()`, `fit()`, `fdescribe()` |
| 25 | + - `no-hardcoded-credentials` (error) — detects hardcoded passwords, tokens, and API keys |
| 26 | + - `no-flaky-selectors` (warn) — flags `nth-child()`, absolute XPath, and generated CSS class selectors |
| 27 | + - `single-assertion-focus` (warn) — warns when a test block exceeds the configured assertion limit |
| 28 | + - `test-isolation-check` (info) — detects shared `let` state declared at describe scope |
| 29 | +- **CLI commands**: `scan`, `init`, `rules` |
| 30 | +- **Three report formats**: `cli` (coloured terminal), `json`, `html` (self-contained single file) |
| 31 | +- **Quality gate exit codes**: exits `1` on errors (or warnings when `failOnWarnings: true`), `0` on pass |
| 32 | +- **`ag.config.json` config file** — customise rules, include/exclude globs, assertion limits, output directory |
| 33 | +- **`assert-guard init`** — scaffolds a default config file |
| 34 | +- **`assert-guard rules`** — lists all available rules with their default severity |
| 35 | +- **GitHub Actions workflows** — CI (test + build on Node 18/20) and npm publish on release |
| 36 | +- **Full TypeScript** — ships with `.d.ts` declarations for use as a library |
| 37 | +- **Programmatic API** — all core functions exported from the main entry point |
| 38 | + |
| 39 | +### Rules detail |
| 40 | + |
| 41 | +| Rule | Default | Catches | |
| 42 | +|------|---------|---------| |
| 43 | +| `no-hard-waits` | error | `cy.wait(N)`, `Thread.sleep()`, `waitForTimeout()` | |
| 44 | +| `no-logic-in-tests` | error | `if`, `for`, `for..of`, `try/catch` inside `it()`/`test()` | |
| 45 | +| `no-focused-tests` | error | `it.only`, `test.only`, `describe.only`, `fit`, `fdescribe` | |
| 46 | +| `no-hardcoded-credentials` | error | hardcoded passwords, tokens, API keys in test files | |
| 47 | +| `no-flaky-selectors` | warn | positional CSS, absolute XPath, generated class names | |
| 48 | +| `single-assertion-focus` | warn | more than N assertions per test (default N=5) | |
| 49 | +| `test-isolation-check` | info | shared `let` state in `describe` scope | |
| 50 | + |
| 51 | +--- |
| 52 | + |
| 53 | +[Unreleased]: https://github.com/qa-ashutosh/assert-guard/compare/v1.0.0...HEAD |
| 54 | +[1.0.0]: https://github.com/qa-ashutosh/assert-guard/releases/tag/v1.0.0 |
0 commit comments