@ddd-ts-kit/eslint-plugin 0.87.0 → 0.89.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/README.fr.md +8 -2
- package/README.md +7 -1
- package/dist/presets/create-ddd-ts-kit.js +10 -2
- package/dist/presets/create-ddd-ts-kit.js.map +1 -1
- package/dist/project/config.d.ts +1 -1
- package/dist/project/config.d.ts.map +1 -1
- package/dist/project/locate.js +46 -11
- package/dist/project/locate.js.map +1 -1
- package/dist/rules/rules.d.ts.map +1 -1
- package/dist/rules/rules.js +12 -0
- package/dist/rules/rules.js.map +1 -1
- package/dist/rules/test-assertion-present.d.ts +2 -0
- package/dist/rules/test-assertion-present.d.ts.map +1 -0
- package/dist/rules/test-assertion-present.js +70 -0
- package/dist/rules/test-assertion-present.js.map +1 -0
- package/dist/rules/test-no-logic.d.ts +2 -0
- package/dist/rules/test-no-logic.d.ts.map +1 -0
- package/dist/rules/test-no-logic.js +46 -0
- package/dist/rules/test-no-logic.js.map +1 -0
- package/dist/rules/test-no-only-no-skip.d.ts +2 -0
- package/dist/rules/test-no-only-no-skip.d.ts.map +1 -0
- package/dist/rules/test-no-only-no-skip.js +53 -0
- package/dist/rules/test-no-only-no-skip.js.map +1 -0
- package/dist/rules/test-no-snapshot.d.ts +2 -0
- package/dist/rules/test-no-snapshot.d.ts.map +1 -0
- package/dist/rules/test-no-snapshot.js +37 -0
- package/dist/rules/test-no-snapshot.js.map +1 -0
- package/dist/rules/test-refusal-by-code.d.ts +2 -0
- package/dist/rules/test-refusal-by-code.d.ts.map +1 -0
- package/dist/rules/test-refusal-by-code.js +71 -0
- package/dist/rules/test-refusal-by-code.js.map +1 -0
- package/dist/rules/test-title-states-a-rule.d.ts +4 -0
- package/dist/rules/test-title-states-a-rule.d.ts.map +1 -0
- package/dist/rules/test-title-states-a-rule.js +68 -0
- package/dist/rules/test-title-states-a-rule.js.map +1 -0
- package/dist/support/descendants.d.ts +5 -2
- package/dist/support/descendants.d.ts.map +1 -1
- package/dist/support/descendants.js +7 -1
- package/dist/support/descendants.js.map +1 -1
- package/dist/support/stepdown/misplaced-functions.js +9 -1
- package/dist/support/stepdown/misplaced-functions.js.map +1 -1
- package/dist/support/tests/test-call.d.ts +20 -0
- package/dist/support/tests/test-call.d.ts.map +1 -0
- package/dist/support/tests/test-call.js +77 -0
- package/dist/support/tests/test-call.js.map +1 -0
- package/dist/support/tests/title-text.d.ts +7 -0
- package/dist/support/tests/title-text.d.ts.map +1 -0
- package/dist/support/tests/title-text.js +22 -0
- package/dist/support/tests/title-text.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/rules/errors-factory-name.fr.md +4 -4
- package/docs/rules/errors-factory-name.md +3 -3
- package/docs/rules/test-assertion-present.fr.md +58 -0
- package/docs/rules/test-assertion-present.md +57 -0
- package/docs/rules/test-no-logic.fr.md +71 -0
- package/docs/rules/test-no-logic.md +70 -0
- package/docs/rules/test-no-only-no-skip.fr.md +56 -0
- package/docs/rules/test-no-only-no-skip.md +55 -0
- package/docs/rules/test-no-snapshot.fr.md +52 -0
- package/docs/rules/test-no-snapshot.md +51 -0
- package/docs/rules/test-refusal-by-code.fr.md +65 -0
- package/docs/rules/test-refusal-by-code.md +64 -0
- package/docs/rules/test-title-states-a-rule.fr.md +63 -0
- package/docs/rules/test-title-states-a-rule.md +62 -0
- package/package.json +1 -1
package/README.fr.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[English](README.md) · **Français**
|
|
2
|
-
<!-- translation-of: README.md sha256:
|
|
2
|
+
<!-- translation-of: README.md sha256:7a5824ccc279f258 -->
|
|
3
3
|
|
|
4
4
|
# @ddd-ts-kit/eslint-plugin
|
|
5
5
|
|
|
@@ -251,6 +251,12 @@ chaque règle à `error`.
|
|
|
251
251
|
| [`event-sourcing/projection-never-appends`](docs/rules/event-sourcing-projection-never-appends.fr.md) | `ddd-ts-kit/event-sourcing-projection-never-appends` | une projection ne nomme aucun *event store*, et une projection alimentée par le store aucun *repository* : elle n'ajoute jamais rien à un flux | `error` | maison |
|
|
252
252
|
| [`event-sourcing/upcaster-required`](docs/rules/event-sourcing-upcaster-required.fr.md) | `ddd-ts-kit/event-sourcing-upcaster-required` | `defineStoredEvent` nomme le type de ses données, déclaré dans le fichier, et une version au-dessus de 1 a un *upcaster* depuis chaque version inférieure (le verrou des formes enregistrées : `ddd-ts-kit check`) | `error` | maison |
|
|
253
253
|
| [`test/no-mocks`](docs/rules/test-no-mocks.fr.md) | `ddd-ts-kit/test-no-mocks` | pas de `vi.mock`, `vi.fn`, `vi.spyOn`, de leurs jumeaux `jest` ni de bibliothèque de *mocks* dans les tests d'un contexte | `warn` | maison |
|
|
254
|
+
| [`test/no-only-no-skip`](docs/rules/test-no-only-no-skip.fr.md) | `ddd-ts-kit/test-no-only-no-skip` | pas de `.only` ni `.skip` sur un test ou un groupe, pas de `fit`, `xit`, `xdescribe`, pas de `.skipIf` ni `.runIf` sur une constante : chaque test s'exécute, ou s'exécute partout où sa condition tient | `error` | maison |
|
|
255
|
+
| [`test/title-states-a-rule`](docs/rules/test-title-states-a-rule.fr.md) | `ddd-ts-kit/test-title-states-a-rule` | le titre d'un test énonce la règle qu'il prouve, en minuscules, après les *rows* et le critère qu'il cite ; jamais `should`, `test`, `works`, ni une méthode ou une classe ; un `describe` nomme l'unité | `warn` | maison |
|
|
256
|
+
| [`test/no-logic`](docs/rules/test-no-logic.fr.md) | `ddd-ts-kit/test-no-logic` | ni `if`, ni `switch`, ni ternaire, ni boucle, ni `try` dans un test : un cas par ligne est un `it.each`, une décision appartient à un *builder*, un *fake* ou un *helper* | `warn` | maison |
|
|
257
|
+
| [`test/assertion-present`](docs/rules/test-assertion-present.fr.md) | `ddd-ts-kit/test-assertion-present` | chaque test vérifie quelque chose : un `expect`, un *helper* `expect...` ou `assert...`, ou le résultat d'un scénario (`thenEvents`, `thenError`) ; un test sans corps est un `it.todo` | `warn` | maison |
|
|
258
|
+
| [`test/refusal-by-code`](docs/rules/test-refusal-by-code.fr.md) | `ddd-ts-kit/test-refusal-by-code` | un refus se vérifie par son code et ses faits, jamais par `toThrow` avec un message, une classe ou rien | `warn` | maison |
|
|
259
|
+
| [`test/no-snapshot`](docs/rules/test-no-snapshot.fr.md) | `ddd-ts-kit/test-no-snapshot` | aucun *matcher* de *snapshot* dans un test : un test vérifie les champs dont la règle dépend | `error` | maison |
|
|
254
260
|
| [`events/name-format`](docs/rules/events-name-format.fr.md) | `ddd-ts-kit/events-name-format` | les noms d'événements suivent `<context>.<aggregate>.<fact>` en kebab-case | `error` | maison |
|
|
255
261
|
| [`events/outbox-required`](docs/rules/events-outbox-required.fr.md) | `ddd-ts-kit/events-outbox-required` | aucun client de *broker* et aucun bus concret dans `domain/` et `application/` ; un *publisher* dépend du port `IntegrationEventPublisher` | `error` | maison |
|
|
256
262
|
| [`events/consumer-idempotent`](docs/rules/events-consumer-idempotent.fr.md) | `ddd-ts-kit/events-consumer-idempotent` | un consommateur se déclare avec un nom `consumer` et un store d'événements traités, jamais par un simple `subscribe` ; dans le style déclaré, `@IntegrationEventHandler` écrit son `consumer` comme une chaîne littérale | `error` | maison |
|
|
@@ -425,7 +431,7 @@ propres noms de règle.
|
|
|
425
431
|
|
|
426
432
|
| Préoccupation | Autorité | Pourquoi |
|
|
427
433
|
|---|---|---|
|
|
428
|
-
| imports et frontières (`layer/*`, `context/published-language-only`, `context/declared-relationship`, `context/published-language-is-a-contract`), `purity/*`, `clean/*`, `test/no-mocks`, `events/name-format`, `domain/*`, `application/*`, le côté code de `events/outbox-required`, `events/consumer-idempotent`, `context/extractable`, `authz/*`, `aspects/outside-in`, `tracing/platform-only`, `domain-events/dispatched-on-save`, `domain-events/transactional-before-commit` sur une classe déclarée, `event-sourcing/*` (sauf le verrou de `event-sourcing/upcaster-required`), `standard/no-parallel-interface`, `declarations/role-declared`, `ports/*`, `scheduling/*` (sauf l'unicité des noms de *jobs*), `language/declared-vocabulary`, `errors/through-factory`, `errors/constructor-not-public`, `errors/factory-name`, `presentation/*`, `lifecycle/*`, `process/*`, `schema/presentation-only`, `imports/alias-only`, `imports/extension` et `governance/recorded-deviation` | ce plugin | il lit l'arbre syntaxique : aucun faux positif dû à une chaîne ou à un commentaire, le masquage de variables et les fonctions fléchées sont compris |
|
|
434
|
+
| imports et frontières (`layer/*`, `context/published-language-only`, `context/declared-relationship`, `context/published-language-is-a-contract`), `purity/*`, `clean/*`, `test/no-mocks`, les six règles sur la forme d'un test (`test/no-only-no-skip`, `test/title-states-a-rule`, `test/no-logic`, `test/assertion-present`, `test/refusal-by-code`, `test/no-snapshot`), `events/name-format`, `domain/*`, `application/*`, le côté code de `events/outbox-required`, `events/consumer-idempotent`, `context/extractable`, `authz/*`, `aspects/outside-in`, `tracing/platform-only`, `domain-events/dispatched-on-save`, `domain-events/transactional-before-commit` sur une classe déclarée, `event-sourcing/*` (sauf le verrou de `event-sourcing/upcaster-required`), `standard/no-parallel-interface`, `declarations/role-declared`, `ports/*`, `scheduling/*` (sauf l'unicité des noms de *jobs*), `language/declared-vocabulary`, `errors/through-factory`, `errors/constructor-not-public`, `errors/factory-name`, `presentation/*`, `lifecycle/*`, `process/*`, `schema/presentation-only`, `imports/alias-only`, `imports/extension` et `governance/recorded-deviation` | ce plugin | il lit l'arbre syntaxique : aucun faux positif dû à une chaîne ou à un commentaire, le masquage de variables et les fonctions fléchées sont compris |
|
|
429
435
|
| l'arborescence (`tree/closed`, `tree/context-doc`), les noms et les fichiers (`naming/*` hormis le côté code de `naming/business-name`, que ce plugin lit sur l'arbre syntaxique et corrige, `test/spec-required`, `test/builder-required`), le langage (`language/glossary-term`, `language/no-technical-name`), les codes d'erreur (`errors/code-unique`, `errors/known-code`), `imports/alias-declared`, `schema/no-duplicate-shape`, la config (`config/*`, `context/no-cycle`), `events/defined-in-published-language`, `composition/only-in-module`, `declarations/barrel-current`, l'unicité des noms de consommateurs et de *jobs*, une seule classe déclarée par fichier de rôle, de `domain-events/transactional-before-commit` les adaptateurs d'un port de `application/ports/` et la phase d'un gestionnaire du style explicite, le côté config des identifiants ci-dessus (`stack.events`, sévérités abaissées, existence d'un enregistrement de décision) | `ddd-ts-kit check` | ils jugent le projet, le glossaire et des fichiers qui ne sont pas des sources ; ESLint juge une source à la fois |
|
|
430
436
|
| le vrai graphe des dépendances (barrels, cycles, orphelins, dépendances de développement dans le code de production) | dependency-cruiser, configuré par le `.dependency-cruiser.cjs` que `ddd-ts-kit depcruise-config --write` génère à partir de la config | il résout les modules au lieu de classer des chemins |
|
|
431
437
|
|
package/README.md
CHANGED
|
@@ -247,6 +247,12 @@ is an error whatever the configured limit). `strict` sets every rule to `error`.
|
|
|
247
247
|
| [`event-sourcing/projection-never-appends`](docs/rules/event-sourcing-projection-never-appends.md) | `ddd-ts-kit/event-sourcing-projection-never-appends` | a projection names no event store, and one fed by the store no repository: it never appends to a stream | `error` | custom |
|
|
248
248
|
| [`event-sourcing/upcaster-required`](docs/rules/event-sourcing-upcaster-required.md) | `ddd-ts-kit/event-sourcing-upcaster-required` | `defineStoredEvent` names the type of its data, declared in the file, and a version above 1 has an upcaster from each version below (the lock of recorded shapes: `ddd-ts-kit check`) | `error` | custom |
|
|
249
249
|
| [`test/no-mocks`](docs/rules/test-no-mocks.md) | `ddd-ts-kit/test-no-mocks` | no `vi.mock`, `vi.fn`, `vi.spyOn`, their `jest` twins or a mocking library in a context's tests | `warn` | custom |
|
|
250
|
+
| [`test/no-only-no-skip`](docs/rules/test-no-only-no-skip.md) | `ddd-ts-kit/test-no-only-no-skip` | no `.only` or `.skip` on a test or a group, no `fit`, `xit`, `xdescribe`, no `.skipIf` or `.runIf` on a constant: every test runs, or runs wherever its condition holds | `error` | custom |
|
|
251
|
+
| [`test/title-states-a-rule`](docs/rules/test-title-states-a-rule.md) | `ddd-ts-kit/test-title-states-a-rule` | the title of a test states the rule it proves, in lower case, after the rows and the criterion it cites; never `should`, `test`, `works`, nor a method or a class; a `describe` names the unit | `warn` | custom |
|
|
252
|
+
| [`test/no-logic`](docs/rules/test-no-logic.md) | `ddd-ts-kit/test-no-logic` | no `if`, `switch`, ternary, loop or `try` in a test: a case per row is an `it.each`, a decision belongs to a builder, a fake or a helper | `warn` | custom |
|
|
253
|
+
| [`test/assertion-present`](docs/rules/test-assertion-present.md) | `ddd-ts-kit/test-assertion-present` | every test asserts something: an `expect`, an `expect...` or `assert...` helper, or the outcome of a scenario (`thenEvents`, `thenError`); a test without a body is an `it.todo` | `warn` | custom |
|
|
254
|
+
| [`test/refusal-by-code`](docs/rules/test-refusal-by-code.md) | `ddd-ts-kit/test-refusal-by-code` | a refusal is asserted by its code and its facts, never by `toThrow` with a message, a class or nothing | `warn` | custom |
|
|
255
|
+
| [`test/no-snapshot`](docs/rules/test-no-snapshot.md) | `ddd-ts-kit/test-no-snapshot` | no snapshot matcher in a test: a test asserts the fields the rule depends on | `error` | custom |
|
|
250
256
|
| [`events/name-format`](docs/rules/events-name-format.md) | `ddd-ts-kit/events-name-format` | event names follow `<context>.<aggregate>.<fact>` in kebab-case | `error` | custom |
|
|
251
257
|
| [`events/outbox-required`](docs/rules/events-outbox-required.md) | `ddd-ts-kit/events-outbox-required` | no broker client and no concrete bus in `domain/` and `application/`; a publisher depends on the `IntegrationEventPublisher` port | `error` | custom |
|
|
252
258
|
| [`events/consumer-idempotent`](docs/rules/events-consumer-idempotent.md) | `ddd-ts-kit/events-consumer-idempotent` | a consumer is declared with a `consumer` name and a processed-event store, never by a bare `subscribe`; in the declared style `@IntegrationEventHandler` writes its `consumer` as a string literal | `error` | custom |
|
|
@@ -415,7 +421,7 @@ config: it runs on a file generated from it, with its own rule names.
|
|
|
415
421
|
|
|
416
422
|
| Concern | Authority | Why |
|
|
417
423
|
|---|---|---|
|
|
418
|
-
| imports and boundaries (`layer/*`, `context/published-language-only`, `context/declared-relationship`, `context/published-language-is-a-contract`), `purity/*`, `clean/*`, `test/no-mocks`, `events/name-format`, `domain/*`, `application/*`, the code side of `events/outbox-required`, `events/consumer-idempotent`, `context/extractable`, `authz/*`, `aspects/outside-in`, `tracing/platform-only`, `domain-events/dispatched-on-save`, `domain-events/transactional-before-commit` on a declared class, `event-sourcing/*` (but the lock of `event-sourcing/upcaster-required`), `standard/no-parallel-interface`, `declarations/role-declared`, `ports/*`, `scheduling/*` (but the uniqueness of job names), `language/declared-vocabulary`, `errors/through-factory`, `errors/constructor-not-public`, `errors/factory-name`, `presentation/*`, `lifecycle/*`, `process/*`, `schema/presentation-only`, `imports/alias-only`, `imports/extension` and `governance/recorded-deviation` | this plugin | it reads the syntax tree: no false positive from a string or a comment, shadowing and arrow functions are understood |
|
|
424
|
+
| imports and boundaries (`layer/*`, `context/published-language-only`, `context/declared-relationship`, `context/published-language-is-a-contract`), `purity/*`, `clean/*`, `test/no-mocks`, the six rules on the shape of a test (`test/no-only-no-skip`, `test/title-states-a-rule`, `test/no-logic`, `test/assertion-present`, `test/refusal-by-code`, `test/no-snapshot`), `events/name-format`, `domain/*`, `application/*`, the code side of `events/outbox-required`, `events/consumer-idempotent`, `context/extractable`, `authz/*`, `aspects/outside-in`, `tracing/platform-only`, `domain-events/dispatched-on-save`, `domain-events/transactional-before-commit` on a declared class, `event-sourcing/*` (but the lock of `event-sourcing/upcaster-required`), `standard/no-parallel-interface`, `declarations/role-declared`, `ports/*`, `scheduling/*` (but the uniqueness of job names), `language/declared-vocabulary`, `errors/through-factory`, `errors/constructor-not-public`, `errors/factory-name`, `presentation/*`, `lifecycle/*`, `process/*`, `schema/presentation-only`, `imports/alias-only`, `imports/extension` and `governance/recorded-deviation` | this plugin | it reads the syntax tree: no false positive from a string or a comment, shadowing and arrow functions are understood |
|
|
419
425
|
| the tree (`tree/closed`, `tree/context-doc`), names and files (`naming/*` but the code side of `naming/business-name`, which this plugin reads on the syntax tree and fixes, `test/spec-required`, `test/builder-required`), the language (`language/glossary-term`, `language/no-technical-name`), error codes (`errors/code-unique`, `errors/known-code`), `imports/alias-declared`, `schema/no-duplicate-shape`, the config (`config/*`, `context/no-cycle`), `events/defined-in-published-language`, `composition/only-in-module`, `declarations/barrel-current`, unique consumer names and job names, one declared class per role file, of `domain-events/transactional-before-commit` the adapters of an `application/ports/` port and the phase of an explicit-style handler, the config side of the ids above (`stack.events`, lowered severities, that a decision record exists) | `ddd-ts-kit check` | they judge the project, the glossary and files that are not sources; ESLint judges one source at a time |
|
|
420
426
|
| the real dependency graph (barrels, cycles, orphans, dev dependencies in production code) | dependency-cruiser, configured by the `.dependency-cruiser.cjs` that `ddd-ts-kit depcruise-config --write` generates from the config | it resolves modules instead of classifying paths |
|
|
421
427
|
|
|
@@ -141,13 +141,21 @@ function levelOf(config, rule) {
|
|
|
141
141
|
const configured = configuredSeverity(config, ruleId);
|
|
142
142
|
return name === eslintName(ruleId) || configured === 'off' ? (configured ?? recommended) : recommended;
|
|
143
143
|
}
|
|
144
|
+
/** The domain and the application of every context, at its level and in each module of its model (`<module>/domain/`). */
|
|
144
145
|
function innerLayerFiles(config) {
|
|
145
|
-
return [
|
|
146
|
+
return ['domain', 'application'].flatMap((layer) => [
|
|
147
|
+
`${config.contextsDir}/*/${layer}/**/*.ts`,
|
|
148
|
+
`${config.contextsDir}/*/*/${layer}/**/*.ts`,
|
|
149
|
+
]);
|
|
146
150
|
}
|
|
147
|
-
/**
|
|
151
|
+
/**
|
|
152
|
+
* The aggregates and entities of a context, at its level or in a module of its model
|
|
153
|
+
* (`<module>/domain/aggregates/`, or `domain/<module>/aggregates/` as 0.86 and 0.87 laid it out).
|
|
154
|
+
*/
|
|
148
155
|
function aggregateFiles(config) {
|
|
149
156
|
return ['aggregates', 'entities'].flatMap((folder) => [
|
|
150
157
|
`${config.contextsDir}/*/domain/${folder}/**/*.ts`,
|
|
158
|
+
`${config.contextsDir}/*/*/domain/${folder}/**/*.ts`,
|
|
151
159
|
`${config.contextsDir}/*/domain/*/${folder}/**/*.ts`,
|
|
152
160
|
]);
|
|
153
161
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"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AAG,MAAM,CAAC,WAAW,QAAQ,KAAK,UAAU;KAC7C,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,SAAS,cAAc,CAAC,MAAc;IACpC,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;QACpD,GAAG,MAAM,CAAC,WAAW,aAAa,MAAM,UAAU;QAClD,GAAG,MAAM,CAAC,WAAW,eAAe,MAAM,UAAU;QACpD,GAAG,MAAM,CAAC,WAAW,eAAe,MAAM,UAAU;KACrD,CAAC,CAAC;AACL,CAAC;AAED,SAAS,SAAS,CAAC,MAAc;IAC/B,OAAO,CAAC,cAAc,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC,WAAW,iBAAiB,EAAE,cAAc,CAAC,CAAC;AAClG,CAAC;AAED,iGAAiG;AACjG,MAAM,WAAW,GAAG;IAClB,gBAAgB;IAChB,sBAAsB;IACtB,yBAAyB;IACzB,gBAAgB;IAChB,oBAAoB;IACpB,kBAAkB;IAClB,eAAe;IACf,+BAA+B;IAC/B,cAAc;IACd,8BAA8B;IAC9B,+BAA+B;IAC/B,wBAAwB;CACzB,CAAC;AAEF,SAAS,iBAAiB,CAAC,KAAY;IACrC,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,sBAAsB,KAAK,EAAE,CAAC,CAAC,CAC/G,CAAC;AACJ,CAAC"}
|
package/dist/project/config.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface ContextConfig {
|
|
|
15
15
|
readonly classification: string;
|
|
16
16
|
readonly upstreams: readonly Upstream[];
|
|
17
17
|
readonly extraDirectories: readonly string[];
|
|
18
|
-
/** The names of the modules of the model of the context, `contexts.<name>.modules`: one folder
|
|
18
|
+
/** The names of the modules of the model of the context, `contexts.<name>.modules`: each one folder of the context holding its layers. */
|
|
19
19
|
readonly modules: readonly string[];
|
|
20
20
|
}
|
|
21
21
|
export type Style = 'declared' | 'explicit';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/project/config.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;AAEhD,wHAAwH;AACxH,UAAU,eAAe;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,0CAA0C;IAC1C,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED,wFAAwF;AACxF,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,eAAe,CAAC;AAEnD,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,SAAS,QAAQ,EAAE,CAAC;IACxC,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7C,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/project/config.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;AAEhD,wHAAwH;AACxH,UAAU,eAAe;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,0CAA0C;IAC1C,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED,wFAAwF;AACxF,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,eAAe,CAAC;AAEnD,MAAM,WAAW,Q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AAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC;IACtE,yFAAyF;IACzF,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,uIAAuI;IACvI,QAAQ,CAAC,GAAG,EAAE,SAAS,GAAG,SAAS,CAAC;CACrC;AAED,uGAAuG;AACvG,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB"}
|
package/dist/project/locate.js
CHANGED
|
@@ -30,24 +30,41 @@ function locateInContexts(config, file) {
|
|
|
30
30
|
if (rest.length === 0) {
|
|
31
31
|
return locateAtContextRoot(context, first);
|
|
32
32
|
}
|
|
33
|
-
const
|
|
34
|
-
const inModule = moduleLocation(config, { context, layer, rest });
|
|
33
|
+
const inModule = moduleLocation(config.contexts[context]?.modules ?? [], context, [first, ...rest]);
|
|
35
34
|
if (inModule !== undefined) {
|
|
36
35
|
return inModule;
|
|
37
36
|
}
|
|
37
|
+
const layer = LAYERS.find((candidate) => candidate === first) ?? 'root';
|
|
38
38
|
return { area: 'context', context, layer, inside: layer === 'root' ? [first, ...rest] : rest };
|
|
39
39
|
}
|
|
40
|
+
/** The layers a module holds, and the test folders of its specs, as `moduleSplit` of the CLI reads them. */
|
|
41
|
+
const MODULE_LAYERS = ['domain', 'application', 'infrastructure', 'presentation'];
|
|
42
|
+
const MODULE_TEST_FOLDERS = ['unit', 'integration'];
|
|
40
43
|
/**
|
|
41
|
-
* A module of the model is one folder
|
|
42
|
-
*
|
|
44
|
+
* A module of the model is one folder of the context holding its layers (`<module>/domain/...`),
|
|
45
|
+
* one folder of the test folders of its specs (`test/unit/<module>/...`), or, as 0.86 and 0.87 laid it out,
|
|
46
|
+
* one folder under domain/ and application/: left out, the rest of the path is what it would be
|
|
47
|
+
* without modules, so every role keeps its place.
|
|
43
48
|
*/
|
|
44
|
-
function moduleLocation(
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
function moduleLocation(modules, context, parts) {
|
|
50
|
+
const placed = inFolderOfModule(modules, parts) ?? inTestFolder(modules, parts) ?? inEarlierPlace(modules, parts);
|
|
51
|
+
return placed === undefined ? undefined : { area: 'context', context, ...placed };
|
|
52
|
+
}
|
|
53
|
+
/** `<module>/<layer>/...`. */
|
|
54
|
+
function inFolderOfModule(modules, [first = '', second = '', ...rest]) {
|
|
55
|
+
const layer = MODULE_LAYERS.find((candidate) => candidate === second);
|
|
56
|
+
return modules.includes(first) && layer !== undefined ? { layer, inside: rest, module: first } : undefined;
|
|
57
|
+
}
|
|
58
|
+
/** `test/<unit|integration>/<module>/...`. */
|
|
59
|
+
function inTestFolder(modules, [first, second = '', module = '', ...below]) {
|
|
60
|
+
return first === 'test' && MODULE_TEST_FOLDERS.includes(second) && modules.includes(module)
|
|
61
|
+
? { layer: 'test', inside: [second, ...below], module }
|
|
62
|
+
: undefined;
|
|
63
|
+
}
|
|
64
|
+
/** `<domain|application>/<module>/...`, as 0.86 and 0.87 laid modules out. */
|
|
65
|
+
function inEarlierPlace(modules, [first = '', second = '', ...rest]) {
|
|
66
|
+
return (first === 'domain' || first === 'application') && modules.includes(second)
|
|
67
|
+
? { layer: first, inside: rest, module: second }
|
|
51
68
|
: undefined;
|
|
52
69
|
}
|
|
53
70
|
/** A directory import (`../billing/published-language`) names the layer without a file. */
|
|
@@ -55,9 +72,27 @@ function locateAtContextRoot(context, entry) {
|
|
|
55
72
|
if (entry === `${context}.module.ts`) {
|
|
56
73
|
return { area: 'context', context, layer: 'module', inside: [] };
|
|
57
74
|
}
|
|
75
|
+
const placed = contextFileAt(context, entry.replace(/\.(?:js|ts)$/, ''));
|
|
76
|
+
if (placed !== undefined) {
|
|
77
|
+
return placed;
|
|
78
|
+
}
|
|
58
79
|
const named = LAYERS.find((candidate) => candidate === entry.replace(/\.ts$/, ''));
|
|
59
80
|
return { area: 'context', context, layer: named ?? 'root', inside: [] };
|
|
60
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* The code list and the permission set of a context sit at its root and are read as they were in
|
|
84
|
+
* their role folder, as `locate` of the CLI reads them: `billing.codes.ts` is
|
|
85
|
+
* `domain/errors/codes.ts`, `billing.permissions.ts` is `application/authorization/billing.permissions.ts`.
|
|
86
|
+
* `stem` is the entry without its extension, as an import may name it.
|
|
87
|
+
*/
|
|
88
|
+
function contextFileAt(context, stem) {
|
|
89
|
+
if (stem === `${context}.codes`) {
|
|
90
|
+
return { area: 'context', context, layer: 'domain', inside: ['errors', 'codes.ts'] };
|
|
91
|
+
}
|
|
92
|
+
return stem === `${context}.permissions`
|
|
93
|
+
? { area: 'context', context, layer: 'application', inside: ['authorization', `${context}.permissions.ts`] }
|
|
94
|
+
: undefined;
|
|
95
|
+
}
|
|
61
96
|
function isUnder(file, directory) {
|
|
62
97
|
return file === directory || file.startsWith(`${directory}/`);
|
|
63
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locate.js","sourceRoot":"","sources":["../../src/project/locate.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,GAAqB;IAC/B,QAAQ;IACR,aAAa;IACb,gBAAgB;IAChB,cAAc;IACd,oBAAoB;IACpB,MAAM;CACP,CAAC;AAEF,0FAA0F;AAC1F,MAAM,UAAU,MAAM,CAAC,MAAc,EAAE,IAAY;IACjD,IAAI,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;QACtC,OAAO,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,IAAI,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC;QAC1C,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;QACtC,OAAO,EAAE,IAAI,EAAE,UAAU,E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AAO,EAAE,EAAE,CAAC,CAAC,CAAC;IAEnF,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AAC1E,CAAC;AAED;;;;;GAKG;AACH,SAAS,aAAa,CAAC,OAAe,EAAE,IAAY;IAClD,IAAI,IAAI,KAAK,GAAG,OAAO,QAAQ,EAAE,CAAC;QAChC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC,EAAE,CAAC;IACvF,CAAC;IAED,OAAO,IAAI,KAAK,GAAG,OAAO,cAAc;QACtC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,eAAe,EAAE,GAAG,OAAO,iBAAiB,CAAC,EAAE;QAC5G,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,SAAS,OAAO,CAAC,IAAY,EAAE,SAAiB;IAC9C,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/rules/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,OAAO,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/rules/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,OAAO,EAAE,MAAM,yBAAyB,CAAC;AA4J/D,+HAA+H;AAC/H,eAAO,MAAM,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEnD,CAAC"}
|
package/dist/rules/rules.js
CHANGED
|
@@ -60,7 +60,13 @@ import { schedulingJobName } from './scheduling-job-name.js';
|
|
|
60
60
|
import { schedulingJobTriggersUseCase } from './scheduling-job-triggers-use-case.js';
|
|
61
61
|
import { schemaPresentationOnly } from './schema-presentation-only.js';
|
|
62
62
|
import { standardNoParallelInterface } from './standard-no-parallel-interface.js';
|
|
63
|
+
import { testAssertionPresent } from './test-assertion-present.js';
|
|
64
|
+
import { testNoLogic } from './test-no-logic.js';
|
|
63
65
|
import { testNoMocks } from './test-no-mocks.js';
|
|
66
|
+
import { testNoOnlyNoSkip } from './test-no-only-no-skip.js';
|
|
67
|
+
import { testNoSnapshot } from './test-no-snapshot.js';
|
|
68
|
+
import { testRefusalByCode } from './test-refusal-by-code.js';
|
|
69
|
+
import { testTitleStatesARule } from './test-title-states-a-rule.js';
|
|
64
70
|
import { cleanNoMagicNumber } from './clean-no-magic-number.js';
|
|
65
71
|
import { languageDeclaredVocabulary } from './language-declared-vocabulary.js';
|
|
66
72
|
import { tracingPlatformOnly } from './tracing-platform-only.js';
|
|
@@ -105,6 +111,12 @@ const ALL = [
|
|
|
105
111
|
eventSourcingProjectionNeverAppends,
|
|
106
112
|
eventSourcingUpcasterRequired,
|
|
107
113
|
testNoMocks,
|
|
114
|
+
testNoOnlyNoSkip,
|
|
115
|
+
testTitleStatesARule,
|
|
116
|
+
testNoLogic,
|
|
117
|
+
testAssertionPresent,
|
|
118
|
+
testRefusalByCode,
|
|
119
|
+
testNoSnapshot,
|
|
108
120
|
eventsNameFormat,
|
|
109
121
|
eventsOutboxRequired,
|
|
110
122
|
eventsConsumerIdempotent,
|
package/dist/rules/rules.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/rules/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAgB,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAC3F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C;AAEF,+HAA+H;AAC/H,MAAM,CAAC,MAAM,KAAK,GAAsC,MAAM,CAAC,WAAW,CACxE,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAC7C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-assertion-present.d.ts","sourceRoot":"","sources":["../../src/rules/test-assertion-present.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,oBAAoB,mKAuC/B,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
import { descendants } from '../support/descendants.js';
|
|
3
|
+
import { propertyName } from '../support/globals/property-name.js';
|
|
4
|
+
import { defineRule } from '../support/rule/define-rule.js';
|
|
5
|
+
import { testCall } from '../support/tests/test-call.js';
|
|
6
|
+
import { titleText } from '../support/tests/title-text.js';
|
|
7
|
+
/** `expect`, `expectRefusal`, `expectProblem`, `assertEquals`: a call that asserts, of the runner, of the kit or of the project. */
|
|
8
|
+
const ASSERTION = /^(?:expect|assert)/;
|
|
9
|
+
/** The outcome of a scenario of `@ddd-ts-kit/testing`: `thenEvents`, `thenError`, `thenState`, `thenNoEvent`. */
|
|
10
|
+
const OUTCOME = /^then[A-Z]/;
|
|
11
|
+
export const testAssertionPresent = defineRule({
|
|
12
|
+
id: 'test/assertion-present',
|
|
13
|
+
type: 'problem',
|
|
14
|
+
recommended: 'warn',
|
|
15
|
+
transition: '0.90.0',
|
|
16
|
+
description: 'Every test asserts something: an `expect`, an `expect...` or `assert...` helper, or the outcome of a scenario (`thenEvents`, `thenError`); a test without a body is written `it.todo`.',
|
|
17
|
+
messages: {
|
|
18
|
+
none: 'The test "{{title}}" asserts nothing: it runs code and passes whatever happens. Assert the outcome: the state of a fake (`expect(await invoices.findById(id))`), the facts recorded (`thenEvents`), the refusal by its code (`thenError`, `expectRefusal`, `rejects.toMatchObject({ code })`), the answer of a route (`expectStatus`, `expectProblem`). A helper that asserts for several tests is named `expect...`, so that the rule sees it.',
|
|
19
|
+
pending: 'The test "{{title}}" has no body: Vitest counts it as a todo and Jest refuses it. Write `it.todo(\'...\')` for a behaviour not proven yet, named after it, or write the test.',
|
|
20
|
+
},
|
|
21
|
+
create({ file, sourceCode, report }) {
|
|
22
|
+
if (!file.isTest) {
|
|
23
|
+
return {};
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
CallExpression(node) {
|
|
27
|
+
const call = testCall(sourceCode, node);
|
|
28
|
+
if (call?.kind !== 'test' || call.modifiers.includes('todo') || call.title === undefined) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const title = titleText(call.title) ?? sourceCode.getText(call.title);
|
|
32
|
+
if (call.body === undefined) {
|
|
33
|
+
report({ node: call.title, messageId: 'pending', data: { title } });
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (!asserts(call.body)) {
|
|
37
|
+
report({ node: call.title, messageId: 'none', data: { title } });
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
/** True when a call below `body` asserts: the body itself, or the scenario `pending(...)` wraps. */
|
|
44
|
+
function asserts(body) {
|
|
45
|
+
for (const inside of descendants(body)) {
|
|
46
|
+
if (inside.type === AST_NODE_TYPES.CallExpression && isAssertion(inside.callee)) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
function isAssertion(callee) {
|
|
53
|
+
if (callee.type === AST_NODE_TYPES.Identifier) {
|
|
54
|
+
return ASSERTION.test(callee.name);
|
|
55
|
+
}
|
|
56
|
+
if (callee.type !== AST_NODE_TYPES.MemberExpression) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
const name = propertyName(callee) ?? '';
|
|
60
|
+
return ASSERTION.test(name) || OUTCOME.test(name) || rootOf(callee)?.name === 'expect';
|
|
61
|
+
}
|
|
62
|
+
/** `expect` for `expect.soft(x).toBe(y)`: the identifier a chain of members and calls starts from. */
|
|
63
|
+
function rootOf(callee) {
|
|
64
|
+
let current = callee.object;
|
|
65
|
+
while (current.type === AST_NODE_TYPES.MemberExpression || current.type === AST_NODE_TYPES.CallExpression) {
|
|
66
|
+
current = current.type === AST_NODE_TYPES.MemberExpression ? current.object : current.callee;
|
|
67
|
+
}
|
|
68
|
+
return current.type === AST_NODE_TYPES.Identifier ? current : undefined;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=test-assertion-present.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-assertion-present.js","sourceRoot":"","sources":["../../src/rules/test-assertion-present.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,oIAAoI;AACpI,MAAM,SAAS,GAAG,oBAAoB,CAAC;AAEvC,iHAAiH;AACjH,MAAM,OAAO,GAAG,YAAY,CAAC;AAE7B,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAqB;IACjE,EAAE,EAAE,wBAAwB;IAC5B,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,MAAM;IACnB,UAAU,EAAE,QAAQ;IACpB,WAAW,EACT,wLAAwL;IAC1L,QAAQ,EAAE;QACR,IAAI,EAAE,ibAAib;QACvb,OAAO,EACL,+KAA+K;KAClL;IACD,MAAM,CAAC,EAAE,I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0 +1,46 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
import { descendants } from '../support/descendants.js';
|
|
3
|
+
import { defineRule } from '../support/rule/define-rule.js';
|
|
4
|
+
import { testCall } from '../support/tests/test-call.js';
|
|
5
|
+
/** The statements and the expression that make a test decide instead of stating. */
|
|
6
|
+
const LOGIC = {
|
|
7
|
+
[AST_NODE_TYPES.IfStatement]: 'An `if`',
|
|
8
|
+
[AST_NODE_TYPES.SwitchStatement]: 'A `switch`',
|
|
9
|
+
[AST_NODE_TYPES.ConditionalExpression]: 'A ternary',
|
|
10
|
+
[AST_NODE_TYPES.ForStatement]: 'A `for`',
|
|
11
|
+
[AST_NODE_TYPES.ForInStatement]: 'A `for`',
|
|
12
|
+
[AST_NODE_TYPES.ForOfStatement]: 'A `for`',
|
|
13
|
+
[AST_NODE_TYPES.WhileStatement]: 'A `while`',
|
|
14
|
+
[AST_NODE_TYPES.DoWhileStatement]: 'A `do`',
|
|
15
|
+
[AST_NODE_TYPES.TryStatement]: 'A `try`',
|
|
16
|
+
};
|
|
17
|
+
export const testNoLogic = defineRule({
|
|
18
|
+
id: 'test/no-logic',
|
|
19
|
+
type: 'suggestion',
|
|
20
|
+
recommended: 'warn',
|
|
21
|
+
transition: '0.90.0',
|
|
22
|
+
description: 'A test holds no `if`, `switch`, ternary, loop or `try`: it arranges, acts and asserts; a case per row is an `it.each`, a decision belongs to a builder, a fake or a helper.',
|
|
23
|
+
messages: {
|
|
24
|
+
logic: '{{what}} in a test: a test holds no logic. It arranges, acts and asserts, and fails for one reason a reader finds without running it. A case per row is an `it.each` with the rows as its table; a decision belongs to a builder (`anInvoice().paid()`), to a fake (`mailer.failNextWith(...)`) or to a helper named after what it decides, in test/e2e/support or next to the world of the context.',
|
|
25
|
+
},
|
|
26
|
+
create({ file, sourceCode, report }) {
|
|
27
|
+
if (!file.isTest) {
|
|
28
|
+
return {};
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
CallExpression(node) {
|
|
32
|
+
const call = testCall(sourceCode, node);
|
|
33
|
+
if (call?.kind !== 'test' || call.body === undefined) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
for (const inside of descendants(call.body)) {
|
|
37
|
+
const what = LOGIC[inside.type];
|
|
38
|
+
if (what !== undefined) {
|
|
39
|
+
report({ node: inside, messageId: 'logic', data: { what } });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=test-no-logic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-no-logic.js","sourceRoot":"","sources":["../../src/rules/test-no-logic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,oFAAoF;AACpF,MAAM,KAAK,GAAsD;IAC/D,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,SAAS;IACvC,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,YAAY;IAC9C,CAAC,cAAc,CAAC,qBAAqB,CAAC,EAAE,WAAW;IACnD,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,SAAS;IACxC,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,SAAS;IAC1C,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,SAAS;IAC1C,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,WAAW;IAC5C,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,QAAQ;IAC3C,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,SAAS;CACzC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAU;IAC7C,EAAE,EAAE,eAAe;IACnB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,MAAM;IACnB,UAAU,EAAE,QAAQ;IACpB,WAAW,EACT,6KAA6K;IAC/K,QAAQ,EAAE;QACR,KAAK,EACH,sYAAsY;KACzY;IACD,MAAM,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE;QACjC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO;YACL,cAAc,CAAC,IAA6B;gBAC1C,MAAM,IAAI,GAAG,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;gBAExC,IAAI,IAAI,EAAE,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;oBACrD,OAAO;gBACT,CAAC;gBAED,KAAK,MAAM,MAAM,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;oBAC5C,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;oBAEhC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;wBACvB,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;oBAC/D,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const testNoOnlyNoSkip: import("@typescript-eslint/utils/ts-eslint").RuleModule<"constant" | "modifier" | "prefixed", [], import("../index.js").RuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
2
|
+
//# sourceMappingURL=test-no-only-no-skip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-no-only-no-skip.d.ts","sourceRoot":"","sources":["../../src/rules/test-no-only-no-skip.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,gBAAgB,qLAwC3B,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
import { defineRule } from '../support/rule/define-rule.js';
|
|
3
|
+
import { testCall } from '../support/tests/test-call.js';
|
|
4
|
+
/** The modifiers that leave a test aside, or run it alone. */
|
|
5
|
+
const ASIDE = new Set(['only', 'skip']);
|
|
6
|
+
/** The modifiers that decide on a condition: left aside for good when the condition is a constant. */
|
|
7
|
+
const CONDITIONAL = new Set(['skipIf', 'runIf']);
|
|
8
|
+
/** `fit` and `xit`, `fdescribe` and `xdescribe`: the same thing, spelt the Jasmine way. */
|
|
9
|
+
const PREFIXED = /^[fx](?:it|test|describe)$/;
|
|
10
|
+
const INSTEAD = 'Every test runs on every machine: a behaviour not written yet is an `it.todo` named after it, a test that is wrong is fixed, and one that proves nothing any more is deleted.';
|
|
11
|
+
export const testNoOnlyNoSkip = defineRule({
|
|
12
|
+
id: 'test/no-only-no-skip',
|
|
13
|
+
type: 'problem',
|
|
14
|
+
recommended: 'error',
|
|
15
|
+
description: 'No `.only` or `.skip` on a test or a group, no `fit`, `xit`, `xdescribe`, no `.skipIf` or `.runIf` on a constant: every test runs, or runs wherever its condition holds; a behaviour not proven yet is an `it.todo`.',
|
|
16
|
+
messages: {
|
|
17
|
+
modifier: `\`{{what}}\` leaves tests aside: with \`only\` the others do not run, with \`skip\` this one does not, and the run is green while something is not proven. ${INSTEAD}`,
|
|
18
|
+
constant: `\`{{what}}\` on a constant leaves this test aside for good, as \`.skip\` would, and the run is green while something is not proven. A condition says where the test runs (\`describe.runIf(process.env['VARNISH_URL'])\`); ${INSTEAD}`,
|
|
19
|
+
prefixed: `\`{{what}}\` focuses or skips as \`.only\` and \`.skip\` do, and the run is green while something is not proven. ${INSTEAD}`,
|
|
20
|
+
},
|
|
21
|
+
create({ file, sourceCode, report }) {
|
|
22
|
+
if (!file.isTest) {
|
|
23
|
+
return {};
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
CallExpression(node) {
|
|
27
|
+
const call = testCall(sourceCode, node);
|
|
28
|
+
if (call === undefined) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (PREFIXED.test(call.root)) {
|
|
32
|
+
report({ node: call.head, messageId: 'prefixed', data: { what: call.root } });
|
|
33
|
+
}
|
|
34
|
+
for (const modifier of call.modifiers.filter((name) => ASIDE.has(name))) {
|
|
35
|
+
report({ node: call.head, messageId: 'modifier', data: { what: `${call.root}.${modifier}` } });
|
|
36
|
+
}
|
|
37
|
+
const conditional = call.modifiers.find((name) => CONDITIONAL.has(name));
|
|
38
|
+
if (conditional !== undefined && onAConstant(call)) {
|
|
39
|
+
report({ node: call.head, messageId: 'constant', data: { what: `${call.root}.${conditional}` } });
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
/** `it.skipIf(true)`, `describe.runIf(false)`, `it.skipIf('')`, `it.skipIf()`: a condition that never changes. */
|
|
46
|
+
function onAConstant({ head }) {
|
|
47
|
+
if (head.type !== AST_NODE_TYPES.CallExpression) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
const [condition] = head.arguments;
|
|
51
|
+
return condition === undefined || condition.type === AST_NODE_TYPES.Literal;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=test-no-only-no-skip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-no-only-no-skip.js","sourceRoot":"","sources":["../../src/rules/test-no-only-no-skip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAiB,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAErE,8DAA8D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AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
import { propertyName } from '../support/globals/property-name.js';
|
|
3
|
+
import { defineRule } from '../support/rule/define-rule.js';
|
|
4
|
+
const SNAPSHOT_MATCHERS = new Set([
|
|
5
|
+
'toMatchSnapshot',
|
|
6
|
+
'toMatchInlineSnapshot',
|
|
7
|
+
'toMatchFileSnapshot',
|
|
8
|
+
'toThrowErrorMatchingSnapshot',
|
|
9
|
+
'toThrowErrorMatchingInlineSnapshot',
|
|
10
|
+
]);
|
|
11
|
+
export const testNoSnapshot = defineRule({
|
|
12
|
+
id: 'test/no-snapshot',
|
|
13
|
+
type: 'problem',
|
|
14
|
+
recommended: 'error',
|
|
15
|
+
description: 'No snapshot matcher in a test: a snapshot records whatever the code produced and is renewed with one flag; a test asserts the fields the rule depends on.',
|
|
16
|
+
messages: {
|
|
17
|
+
snapshot: '`{{matcher}}` records whatever the code produced and is renewed with one flag: it asserts nothing a reader can check against the rule. Assert the fields the rule depends on: `toEqual` on a small value built in the test, `toMatchObject` on the facts that matter, `thenEvents` on the facts recorded.',
|
|
18
|
+
},
|
|
19
|
+
create({ file, report }) {
|
|
20
|
+
if (!file.isTest) {
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
CallExpression(node) {
|
|
25
|
+
const { callee } = node;
|
|
26
|
+
if (callee.type !== AST_NODE_TYPES.MemberExpression) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const matcher = propertyName(callee) ?? '';
|
|
30
|
+
if (SNAPSHOT_MATCHERS.has(matcher)) {
|
|
31
|
+
report({ node: callee.property, messageId: 'snapshot', data: { matcher } });
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=test-no-snapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-no-snapshot.js","sourceRoot":"","sources":["../../src/rules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