eslint-plugin-test-governance 0.13.2 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +90 -1
- package/README.md +118 -445
- package/dist/index.d.ts +3 -3
- package/dist/index.js +11 -3
- package/dist/rules/{no-conflicting-states.d.ts → consistent-tag-names.d.ts} +1 -1
- package/dist/rules/{no-conflicting-states.js → consistent-tag-names.js} +2 -29
- package/dist/rules/limit-retries.d.ts +2 -0
- package/dist/rules/limit-retries.js +28 -0
- package/dist/rules/marker-matches-state.js +4 -1
- package/dist/rules/require-ticket-for-commented-out-tests.js +4 -4
- package/dist/rules/require-ticket.js +5 -5
- package/dist/utils/analyze.d.ts +5 -5
- package/dist/utils/analyze.js +514 -205
- package/dist/utils/constants.d.ts +1 -4
- package/dist/utils/constants.js +1 -3
- package/dist/utils/create-rule.d.ts +1 -1
- package/dist/utils/fix.js +7 -6
- package/dist/utils/frameworks.d.ts +2 -0
- package/dist/utils/frameworks.js +7 -6
- package/dist/utils/options.d.ts +7 -10
- package/dist/utils/options.js +3 -6
- package/dist/utils/schema.js +12 -11
- package/dist/utils/tickets.js +10 -5
- package/dist/utils/validate.d.ts +2 -0
- package/dist/utils/validate.js +3 -0
- package/docs/configuration.md +400 -0
- package/docs/frameworks.md +228 -0
- package/docs/rules/consistent-tag-names.md +79 -0
- package/docs/rules/limit-retries.md +94 -0
- package/docs/rules/marker-matches-state.md +28 -11
- package/docs/rules/no-orphaned-marker.md +33 -14
- package/docs/rules/require-ticket-for-commented-out-tests.md +30 -12
- package/docs/rules/require-ticket-in-comments.md +19 -17
- package/docs/rules/require-ticket.md +130 -41
- package/docs/troubleshooting.md +77 -0
- package/docs/upgrading.md +103 -31
- package/package.json +1 -1
- package/docs/rules/no-conflicting-states.md +0 -85
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,93 @@ All notable changes to this project are documented here. The format follows
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.14.0] - 2026-11-10
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Treat arguments passed to Mocha, Cypress and WebdriverIO `this.skip()` as ignored, so a false
|
|
14
|
+
argument cannot hide an unconditional skip or explain a conditional one.
|
|
15
|
+
- Accept OpenProject short links under installation base paths and semantic work-package IDs,
|
|
16
|
+
while rejecting their zero-number placeholders.
|
|
17
|
+
- Read ticket IDs from URLs matched by custom patterns, rejecting zero IDs without mistaking
|
|
18
|
+
unrelated title suffixes or query values for placeholders.
|
|
19
|
+
- Recognize Vitest function titles without analyzing the name function as an executed body,
|
|
20
|
+
and preserve options, runtime contexts and ticket-to-metadata suggestions.
|
|
21
|
+
- Find commented-out tests through namespace aliases and recognize CommonJS-only test files,
|
|
22
|
+
while retaining protection against reassigned helpers and suite-hook aliases.
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- Add the opt-in `limit-retries` rule for Playwright, Jest, Vitest, Mocha, Cypress and WebdriverIO.
|
|
27
|
+
It checks readable native retry counts against the shared `maxRetries` setting (default `2`),
|
|
28
|
+
independently of retry ticket requirements. Framework configs leave the rule off.
|
|
29
|
+
- Recognize chained Mocha retry setters such as `it('example', fn).retries(3)` for retry ticketing
|
|
30
|
+
as well as retry limits.
|
|
31
|
+
|
|
32
|
+
### Removed
|
|
33
|
+
|
|
34
|
+
- **Breaking:** remove `lifecycleTags`, `states.new`, `states.quarantined` and their tag overrides.
|
|
35
|
+
Use explicit `customStates` mappings for any tag that should require a ticket. Removed settings
|
|
36
|
+
fail with migration instructions; native runner states keep their existing defaults.
|
|
37
|
+
- Remove the built-in checks for `@new` on a skipped test and for `@new` combined with `@quarantined`.
|
|
38
|
+
Custom tags have no prescribed lifecycle or conflicts.
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
|
|
42
|
+
- **Breaking:** rename `no-conflicting-states` to `consistent-tag-names`. It retains case fixes and
|
|
43
|
+
spelling checks for `customStates` and `knownTags`; the old rule name fails with migration guidance.
|
|
44
|
+
See the [upgrade guide](docs/upgrading.md#upgrading-to-014-custom-tag-states).
|
|
45
|
+
|
|
46
|
+
- Reorganize documentation around a complete first lint run, with separate configuration, framework
|
|
47
|
+
and troubleshooting references. Clarify supported version combinations, optional states, example
|
|
48
|
+
settings and recent upgrade actions; retain existing README section links.
|
|
49
|
+
|
|
50
|
+
## [0.13.3] - 2026-11-09
|
|
51
|
+
|
|
52
|
+
### Fixed
|
|
53
|
+
|
|
54
|
+
- Vitest conditional factories can clear an earlier skip in a modifier chain. Runtime context methods
|
|
55
|
+
retain their state through TypeScript wrappers on the receiver or method.
|
|
56
|
+
- Mutation detection follows wrapped references and aliases, and recognizes writes through the global
|
|
57
|
+
`Object` and `Reflect` mutation methods without treating shadowed helpers as those built-ins.
|
|
58
|
+
- Retry counts are read through local constants and object members, with effective properties after
|
|
59
|
+
spreads and overrides. Unread spreads remain possible retries unless every relevant count is known.
|
|
60
|
+
- Commented-out tests no longer hide a broken marker or a disallowed note behind another valid marker.
|
|
61
|
+
- Negative numeric and bigint template interpolations, `void`, and unshadowed `undefined`, `NaN` and
|
|
62
|
+
`Infinity` retain their rendered text when checking tag boundaries.
|
|
63
|
+
- Mutable constant objects and arrays no longer supply stale tag or annotation values after detected
|
|
64
|
+
property writes, deletion, array mutation or writes through a local alias.
|
|
65
|
+
- Runtime context methods keep their original test owner inside nested subtests. Vitest skip notes
|
|
66
|
+
supplied through constants remain unconditional skips.
|
|
67
|
+
- Test callees retain their meaning through TypeScript assertions and type instantiations, sequence
|
|
68
|
+
expressions and defaulted local destructuring. Repeated conditional factories use the final condition.
|
|
69
|
+
- Nested conditional returns and throws, and conditional loop breaks and continues, guard later runtime
|
|
70
|
+
skips. Jest retry calls are recognized through CommonJS object bindings and method aliases, including
|
|
71
|
+
bound arguments.
|
|
72
|
+
- Primitive template interpolations retain their rendered text when checking tag boundaries. Object
|
|
73
|
+
prototype setters do not count as own tag or metadata properties, and suggestions use computed keys
|
|
74
|
+
for metadata named `__proto__`.
|
|
75
|
+
- Test functions are read through aliases of whole modules, local destructuring, bound functions and
|
|
76
|
+
nested conditional selections. Reassigning an alias to a helper no longer leaves it treated as a test.
|
|
77
|
+
- Runtime test contexts and their methods keep their meaning through chains of aliases, `bind()` and
|
|
78
|
+
default parameter values. Arguments supplied by `bind()` retain their condition and reason, and a
|
|
79
|
+
bound title no longer gives a diagnostic whose end is before its start.
|
|
80
|
+
- A runtime skip in a conditional loop, or after a conditional early exit inside a nested block, is
|
|
81
|
+
read as conditional. A TypeScript assertion around a literal boolean keeps that boolean's meaning.
|
|
82
|
+
- With the retry state on, Jest's retry calls are read through renamed and namespace imports, and a
|
|
83
|
+
Mocha describe chosen by a condition still supplies its suite context for `this.retries()`.
|
|
84
|
+
- Chains of constants retain their tags, details and annotation tickets. An unread computed property
|
|
85
|
+
no longer leaves an earlier member of a tag object treated as certain.
|
|
86
|
+
- Tags from literal and nested template interpolations are checked using the rendered text's boundaries,
|
|
87
|
+
so joining text around an `@` doesn't invent a state tag. Plain Vitest tags written as templates count
|
|
88
|
+
like quoted strings. Cyclic constant and template definitions remain unread instead of recursing.
|
|
89
|
+
- `annotations.only` checks every supplied issue ticket, including an invalid one next to a valid one.
|
|
90
|
+
- The commented-out-test rule recognizes renamed test imports.
|
|
91
|
+
- Removing an orphaned marker removes its complete line with CR or Unicode line endings too.
|
|
92
|
+
- A suggestion to add another state's marker no longer copies a ticket that state's format rejects.
|
|
93
|
+
- Suggestions that move a ticket into annotations escape line breaks in the annotation type or key,
|
|
94
|
+
keeping the suggested JavaScript valid.
|
|
95
|
+
|
|
9
96
|
## [0.13.2] - 2026-11-08
|
|
10
97
|
|
|
11
98
|
### Fixed
|
|
@@ -598,7 +685,9 @@ First release.
|
|
|
598
685
|
- Support for ESLint 9 and 10 flat config, JavaScript and TypeScript test files, `.extend()`
|
|
599
686
|
fixtures, describe blocks, runtime skips and tags in titles or the `tag` option.
|
|
600
687
|
|
|
601
|
-
[Unreleased]: https://github.com/Huldoser/eslint-plugin-test-governance/compare/v0.
|
|
688
|
+
[Unreleased]: https://github.com/Huldoser/eslint-plugin-test-governance/compare/v0.14.0...HEAD
|
|
689
|
+
[0.14.0]: https://github.com/Huldoser/eslint-plugin-test-governance/compare/v0.13.3...v0.14.0
|
|
690
|
+
[0.13.3]: https://github.com/Huldoser/eslint-plugin-test-governance/compare/v0.13.2...v0.13.3
|
|
602
691
|
[0.13.2]: https://github.com/Huldoser/eslint-plugin-test-governance/compare/v0.13.1...v0.13.2
|
|
603
692
|
[0.13.1]: https://github.com/Huldoser/eslint-plugin-test-governance/compare/v0.13.0...v0.13.1
|
|
604
693
|
[0.13.0]: https://github.com/Huldoser/eslint-plugin-test-governance/compare/v0.12.1...v0.13.0
|