@jterrazz/test 18.0.1 → 18.0.3
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/dist/checker.js +4 -3
- package/dist/vitest.js +3 -3
- package/docs/reference/linting.md +1 -1
- package/docs/start/set-up-a-project.md +10 -10
- package/package.json +1 -1
package/dist/checker.js
CHANGED
|
@@ -3787,14 +3787,15 @@ function configIn(directory, names) {
|
|
|
3787
3787
|
const name = names.find((candidate) => existsSync(join(directory, candidate)));
|
|
3788
3788
|
return name === void 0 ? void 0 : join(directory, name);
|
|
3789
3789
|
}
|
|
3790
|
-
/** The outermost of each subtree, which covers the ones inside it. */
|
|
3790
|
+
/** The outermost of each subtree, which covers the ones inside it, found as git lists the tree, so a folder git ignores is never entered and a config inside it never loaded. */
|
|
3791
3791
|
function nestedConfigDirectories(root) {
|
|
3792
3792
|
const found = [];
|
|
3793
3793
|
const walk = (directory) => {
|
|
3794
|
-
for (const entry of
|
|
3794
|
+
for (const entry of treeEntries(directory)) {
|
|
3795
3795
|
if (!entry.isDirectory() || UNWALKED.has(entry.name)) continue;
|
|
3796
3796
|
const path = join(directory, entry.name);
|
|
3797
|
-
|
|
3797
|
+
const names = treeNames(path);
|
|
3798
|
+
if (NESTED_CONFIG_NAMES.some((name) => names.includes(name))) found.push(relative(root, path));
|
|
3798
3799
|
else walk(path);
|
|
3799
3800
|
}
|
|
3800
3801
|
};
|
package/dist/vitest.js
CHANGED
|
@@ -452,8 +452,8 @@ function isInline(project) {
|
|
|
452
452
|
function rootExcludeBeside(projects, exclude) {
|
|
453
453
|
return projects.every(isInline) ? exclude.filter((glob) => !EXCLUDE.includes(glob)) : exclude;
|
|
454
454
|
}
|
|
455
|
-
function withProjectDefaults(project) {
|
|
456
|
-
return isInline(project) ? onProjectDefaults(project) : project;
|
|
455
|
+
function withProjectDefaults(project, maxWorkers) {
|
|
456
|
+
return isInline(project) ? mergeConfig({ test: { maxWorkers } }, onProjectDefaults(project)) : project;
|
|
457
457
|
}
|
|
458
458
|
function presetConfig(stated = {}) {
|
|
459
459
|
const merged = mergeConfig(rootDefaults(), stated);
|
|
@@ -463,7 +463,7 @@ function presetConfig(stated = {}) {
|
|
|
463
463
|
...merged,
|
|
464
464
|
test: root
|
|
465
465
|
};
|
|
466
|
-
const inline = projects.map(withProjectDefaults);
|
|
466
|
+
const inline = projects.map((project) => withProjectDefaults(project, root.maxWorkers));
|
|
467
467
|
return {
|
|
468
468
|
...merged,
|
|
469
469
|
test: {
|
|
@@ -417,7 +417,7 @@ This package records and judges its consumers' debt. The family keeps one tracke
|
|
|
417
417
|
|
|
418
418
|
- **It re-records both falls** (lowering an entry or dropping it) before it judges.
|
|
419
419
|
- **It runs the plugin's own autofixes first**, after its own rewrites and movers: the project's oxlint, under a wrapper of its root config that arms the `jterrazz/*` rules alone, in that config and in every config it extends: a plugin armed through `extends` keeps its fixes, and a JSON config, `.jsonc` or extended, is read as oxlint reads it, comments and trailing commas allowed. So no other rulebook's fixer writes a byte, and the ratchets count the checker's findings and the plugin's diagnostics over the one tree they leave: one `typescript fix` settles a diagnostic its fix writes (`no-repeated-chain-setting`'s view, `one-describe-per-file`'s describe, `expected-constant-shared`'s shared expectation).
|
|
420
|
-
- **A nested oxlint config gets a run of its own**, under the same wrapper of ITS config: a config handed with `-c` turns oxlint's nested discovery off, so the root's run leaves the subtree alone rather than write where another config governs, and the subtree's run fixes it by the config the ratchet's count judges it by.
|
|
420
|
+
- **A nested oxlint config gets a run of its own**, under the same wrapper of ITS config: a config handed with `-c` turns oxlint's nested discovery off, so the root's run leaves the subtree alone rather than write where another config governs, and the subtree's run fixes it by the config the ratchet's count judges it by. The configs are found as `typescript check` lists the tree, through git: a folder git ignores is never entered, so a config below it, a clone under a sealed workbench, is never loaded.
|
|
421
421
|
- **A config oxlint could not load under the wrapper stops `typescript fix`**, naming it: oxlint exits 1 for it as for diagnostics left, and a pass that read it as the latter would have fixed nothing and said nothing.
|
|
422
422
|
|
|
423
423
|
#### Which run owns the verdict
|
|
@@ -125,16 +125,16 @@ const integration = {
|
|
|
125
125
|
|
|
126
126
|
### What the preset sets
|
|
127
127
|
|
|
128
|
-
| Setting | Value | Why
|
|
129
|
-
| -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
|
|
130
|
-
| `test.testTimeout`, `hookTimeout` | `30_000` | vitest's 5 s never survived a container boot or a build
|
|
131
|
-
| `test.retry` | `0` | A flaky test is fixed or deleted; a retry hides it
|
|
132
|
-
| `test.restoreMocks`, `unstubGlobals`, `unstubEnvs` | `true` | A spy, a stubbed global or a stubbed env a test forgets to restore would fail a later file that did nothing wrong
|
|
133
|
-
| `test.exclude` | vitest's defaults + `.artifacts/**` + `**/{__expected__,__fixtures__,__requests__,__seeds__}/**` | What a test stands on is input, never a suite to run; `.artifacts/` holds copies of the project, a mutation sandbox among them
|
|
134
|
-
| `cacheDir`, `test.coverage.reportsDirectory`, `test.attachmentsDir`, `test.outputFile` | under `.artifacts/vitest/` | Everything a tool writes lives at `.artifacts/<tool>/` ([below](#where-a-run-writes))
|
|
135
|
-
| `test.globalSetup` | update mode, the run's temp root | Update mode writes after the run is reported; the temp root is [below](#where-a-run-writes)
|
|
136
|
-
| `test.maxWorkers` | the Vitest workers of the toolchain's capacity model
|
|
137
|
-
| `test.env.NODE_COMPILE_CACHE` | `.artifacts/node-compile-cache/`, as an absolute path | Every Node process a run starts reuses the code an earlier one compiled ([below](#where-a-run-writes))
|
|
128
|
+
| Setting | Value | Why |
|
|
129
|
+
| -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
130
|
+
| `test.testTimeout`, `hookTimeout` | `30_000` | vitest's 5 s never survived a container boot or a build |
|
|
131
|
+
| `test.retry` | `0` | A flaky test is fixed or deleted; a retry hides it |
|
|
132
|
+
| `test.restoreMocks`, `unstubGlobals`, `unstubEnvs` | `true` | A spy, a stubbed global or a stubbed env a test forgets to restore would fail a later file that did nothing wrong |
|
|
133
|
+
| `test.exclude` | vitest's defaults + `.artifacts/**` + `**/{__expected__,__fixtures__,__requests__,__seeds__}/**` | What a test stands on is input, never a suite to run; `.artifacts/` holds copies of the project, a mutation sandbox among them |
|
|
134
|
+
| `cacheDir`, `test.coverage.reportsDirectory`, `test.attachmentsDir`, `test.outputFile` | under `.artifacts/vitest/` | Everything a tool writes lives at `.artifacts/<tool>/` ([below](#where-a-run-writes)) |
|
|
135
|
+
| `test.globalSetup` | update mode, the run's temp root | Update mode writes after the run is reported; the temp root is [below](#where-a-run-writes) |
|
|
136
|
+
| `test.maxWorkers` | the Vitest workers of the toolchain's capacity model, read once and stated on every project | A run takes its share of the machine beside the gates running on it, and a run inside a gate's slice (`TYPESCRIPT_CAPACITY`) stays in it; Vitest evaluates the config again for a project with its own server and refuses one group of two worker counts, so a capacity that moves mid-run moves no project ([the toolchain's Quality checks § How many test runners](https://github.com/jterrazz/package-typescript/blob/main/docs/reference/quality-checks.md#how-many-test-runners)) |
|
|
137
|
+
| `test.env.NODE_COMPILE_CACHE` | `.artifacts/node-compile-cache/`, as an absolute path | Every Node process a run starts reuses the code an earlier one compiled ([below](#where-a-run-writes)) |
|
|
138
138
|
|
|
139
139
|
Coverage attaches to every process a run spawns (`autoAttachSubprocess`), and reads `dist/` only to map each bundle back to the source it was built from (`excludeAfterRemap`): a spec that runs the built command counts toward the sources it exercised. A coverage run compiles without the cache: vitest turns it off, since V8 stores a cached script without the source positions precise coverage reads.
|
|
140
140
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jterrazz/test",
|
|
3
|
-
"version": "18.0.
|
|
3
|
+
"version": "18.0.3",
|
|
4
4
|
"description": "Declarative testing framework for HTTP APIs, CLIs, background jobs, websites, mobile apps, rendered components and the rules a project ships: one entry point, real infrastructure and a real browser, golden-file assertions, plus an oxlint convention plugin.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api-testing",
|