@systemfsoftware/oxlint-plugin-test-discipline 4.0.0 → 4.1.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 +12 -0
- package/dist/index.mjs +7 -6
- package/package.json +8 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @systemfsoftware/oxlint-plugin-test-discipline
|
|
2
2
|
|
|
3
|
+
## 4.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- The `contract` test suffix is retired. `test-suffix-outside-src` now reports a test file named with the `contract` suffix, and the behaviour-test rules (`behaviour-test-requires-gherkin`, `behaviour-one-feature-per-file`, `behaviour-exercises-use-case`, `no-pseudo-gherkin-unit-tests`) apply to the `integration` suffix alone. Rename a suite that drives a real medium to the `integration` suffix.
|
|
8
|
+
|
|
9
|
+
## 4.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- `in-source-test-targets-private`'s message now names an exported operation in the `it.prop` `subject` slot as a legal target for an in-source block, beside a private helper.
|
|
14
|
+
|
|
3
15
|
## 4.0.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/index.mjs
CHANGED
|
@@ -81,6 +81,7 @@ const SANCTIONED_TEST_DIRS = /* @__PURE__ */ new Set(["tests"]);
|
|
|
81
81
|
const NESTED_TEST_DIR = "__tests__";
|
|
82
82
|
const TEST_TREE_DIRS = /* @__PURE__ */ new Set([...SANCTIONED_TEST_DIRS, NESTED_TEST_DIR]);
|
|
83
83
|
const PROPERTY_SUFFIX = ".property.test.ts";
|
|
84
|
+
const INTEGRATION_SUFFIX = ".integration.test.ts";
|
|
84
85
|
const DIFFERENTIAL_SUFFIX = ".differential.test.ts";
|
|
85
86
|
/**
|
|
86
87
|
* Forbidden outright. A schema's laws are generated, so a hand-written
|
|
@@ -152,7 +153,7 @@ const isInTestsImportScope = (filename) => {
|
|
|
152
153
|
};
|
|
153
154
|
const isInConfiguredTestDir = (filename, dirs) => directoriesOf(filename).some((segment) => dirs.includes(segment));
|
|
154
155
|
const isTestFile = (basename) => TEST_BASENAME.test(basename);
|
|
155
|
-
const isBehaviourBasename = (basename) => basename.endsWith(
|
|
156
|
+
const isBehaviourBasename = (basename) => basename.endsWith(INTEGRATION_SUFFIX);
|
|
156
157
|
const CELL_SUFFIX = /\.([^.]+)\.[cm]?tsx?$/;
|
|
157
158
|
const cellOf = (basename) => CELL_SUFFIX.exec(basename)?.[1];
|
|
158
159
|
//#endregion
|
|
@@ -915,12 +916,12 @@ const NOT_MODULE_LEVEL_EXPECTED = "the in-source test block as a direct statemen
|
|
|
915
916
|
const NOT_MODULE_LEVEL_ACTUAL = "an `import.meta.vitest` block nested inside another statement";
|
|
916
917
|
const NOT_MODULE_LEVEL_FIX = "move the block to module level — a nested block does not run under vitest includeSource";
|
|
917
918
|
const NO_PRIVATE_TARGET_NAME = "an `import.meta.vitest` block touching no module-level binding";
|
|
918
|
-
const NO_PRIVATE_TARGET_EXPECTED = "an in-source test exercising this module's own code — a private helper, or
|
|
919
|
+
const NO_PRIVATE_TARGET_EXPECTED = "an in-source test exercising this module's own code — a private helper, or an exported operation named in the `it.prop` `subject` slot";
|
|
919
920
|
const NO_PRIVATE_TARGET_ACTUAL = "an in-source block referencing only exported-call or imported names";
|
|
920
|
-
const NO_PRIVATE_TARGET_FIX = "
|
|
921
|
+
const NO_PRIVATE_TARGET_FIX = "touch this module. A private helper is referenced directly; an exported operation is named in the `it.prop` `subject` slot beside its declaration — that is the one home for its laws and the file whose mutants they run. What the block cannot hold is a behaviour binding no module-level name: test the public surface from tests/ as *.integration.test.ts instead";
|
|
921
922
|
const meta$20 = {
|
|
922
923
|
type: "problem",
|
|
923
|
-
docs: { description: "In-source `if (import.meta.vitest)` blocks under src/ must be at module level and exercise
|
|
924
|
+
docs: { description: "In-source `if (import.meta.vitest)` blocks under src/ must be at module level and exercise this module's own code — a private helper, or an exported operation named in the `it.prop` `subject` slot; a public-surface test belongs in tests/ as an integration test." },
|
|
924
925
|
schema: [],
|
|
925
926
|
messages: {
|
|
926
927
|
notModuleLevel: MESSAGE$8,
|
|
@@ -3105,9 +3106,9 @@ const testFileOutsideTestsDir = defineRule({
|
|
|
3105
3106
|
});
|
|
3106
3107
|
//#endregion
|
|
3107
3108
|
//#region src/rules/test-suffix-outside-src.config.ts
|
|
3108
|
-
const UNSANCTIONED_SUFFIX_EXPECTED = "*.integration.test.ts, *.
|
|
3109
|
+
const UNSANCTIONED_SUFFIX_EXPECTED = "*.integration.test.ts, *.differential.test.ts, *.trace.test.ts, or *.conformance.test.ts";
|
|
3109
3110
|
const UNSANCTIONED_SUFFIX_ACTUAL = "another test suffix outside src/";
|
|
3110
|
-
const UNSANCTIONED_SUFFIX_FIX = "public surface
|
|
3111
|
+
const UNSANCTIONED_SUFFIX_FIX = "public surface or real medium -> *.integration.test.ts; parity -> *.differential.test.ts; span graph -> *.trace.test.ts; concurrent or stateful behaviour -> *.conformance.test.ts; pure-cell property -> in-source; restated literal -> delete";
|
|
3111
3112
|
//#endregion
|
|
3112
3113
|
//#region src/rules/test-suffix-outside-src.ts
|
|
3113
3114
|
const testSuffixOutsideSrc = defineRule({
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@systemfsoftware/oxlint-plugin-test-discipline",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.1.0",
|
|
5
5
|
"author": "Ryan Lee <drdgvhbh@gmail.com>",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"@microsoft/api-extractor": "^7.59.1",
|
|
46
46
|
"@systemfsoftware/arethetypeswrong-cli": "^4.2.0",
|
|
47
47
|
"@systemfsoftware/stryker-config": "^0.1.0",
|
|
48
|
-
"@systemfsoftware/stryker-ignorer-effect-schema-declarations": "
|
|
49
|
-
"@systemfsoftware/stryker-ignorer-in-source-vitest-block": "
|
|
50
|
-
"@systemfsoftware/stryker-js": "
|
|
51
|
-
"@systemfsoftware/stryker-js-typescript-checker": "
|
|
52
|
-
"@systemfsoftware/stryker-js-vitest-runner": "
|
|
53
|
-
"@systemfsoftware/stryker-test-contribution": "
|
|
48
|
+
"@systemfsoftware/stryker-ignorer-effect-schema-declarations": "latest",
|
|
49
|
+
"@systemfsoftware/stryker-ignorer-in-source-vitest-block": "latest",
|
|
50
|
+
"@systemfsoftware/stryker-js": "latest",
|
|
51
|
+
"@systemfsoftware/stryker-js-typescript-checker": "latest",
|
|
52
|
+
"@systemfsoftware/stryker-js-vitest-runner": "latest",
|
|
53
|
+
"@systemfsoftware/stryker-test-contribution": "latest",
|
|
54
54
|
"@systemfsoftware/tsconfig": "^2.0.1",
|
|
55
55
|
"@systemfsoftware/tsdown-config": "^0.1.0",
|
|
56
56
|
"@systemfsoftware/vitest-config": "^0.1.0",
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
"typescript": ">=5.0.0"
|
|
70
70
|
},
|
|
71
71
|
"publishConfig": {
|
|
72
|
+
"access": "public",
|
|
72
73
|
"provenance": true
|
|
73
74
|
},
|
|
74
75
|
"scripts": {
|