mootant 0.2.0 → 0.3.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/bin/mootant.js +3 -2
- package/dist/adapters/jest/collect-jest-dependencies.d.ts +8 -6
- package/dist/adapters/jest/collect-jest-dependencies.js +20 -14
- package/dist/adapters/jest/get-jest-cache-inputs.d.ts +14 -13
- package/dist/adapters/jest/index.d.ts +3 -1
- package/dist/adapters/jest/run-dry.js +20 -20
- package/dist/adapters/jest/start-jest-session.d.ts +6 -2
- package/dist/adapters/jest/start-jest-session.js +9 -2
- package/dist/adapters/jest/types/jest-handle.d.ts +2 -1
- package/dist/adapters/jest/types/jest-record.d.ts +4 -3
- package/dist/adapters/jest/types/worker-channel.d.ts +7 -0
- package/dist/adapters/jest/worker/boot-worker.d.ts +5 -4
- package/dist/adapters/jest/worker/create-test-runner.d.ts +4 -1
- package/dist/adapters/jest/worker/keep-reset-loads.d.ts +13 -0
- package/dist/adapters/jest/worker/list-runtime-files.d.ts +13 -0
- package/dist/adapters/jest/worker/run-unit.d.ts +25 -20
- package/dist/adapters/jest/worker/vm-setup.js +1 -1
- package/dist/adapters/jest/worker/worker.js +1 -1
- package/dist/adapters/node-test/check-typescript.js +2 -2
- package/dist/adapters/node-test/collect-node-dependencies.d.ts +7 -5
- package/dist/adapters/node-test/collect-node-dependencies.js +26 -20
- package/dist/adapters/node-test/create-spare-processes.d.ts +26 -0
- package/dist/adapters/node-test/create-spare-processes.js +53 -0
- package/dist/adapters/node-test/filter-exec-argv.d.ts +2 -1
- package/dist/adapters/node-test/filter-exec-argv.js +13 -12
- package/dist/adapters/node-test/get-node-cache-inputs.js +1 -1
- package/dist/adapters/node-test/get-unit-deadline.d.ts +6 -5
- package/dist/adapters/node-test/index.d.ts +2 -2
- package/dist/adapters/node-test/index.js +1 -0
- package/dist/adapters/node-test/is-group-alive.d.ts +8 -0
- package/dist/adapters/node-test/is-group-alive.js +8 -0
- package/dist/adapters/node-test/list-setup-files.js +2 -2
- package/dist/adapters/node-test/place-preload.d.ts +2 -1
- package/dist/adapters/node-test/place-preload.js +24 -18
- package/dist/adapters/node-test/preload/create-commonjs-route.js +1 -1
- package/dist/adapters/node-test/preload/preload.js +54 -52
- package/dist/adapters/node-test/preload/read-line-sync.d.ts +11 -0
- package/dist/adapters/node-test/preload/read-line-sync.js +25 -0
- package/dist/adapters/node-test/preload/read-unit.d.ts +11 -5
- package/dist/adapters/node-test/preload/read-unit.js +5 -4
- package/dist/adapters/node-test/run-isolated.d.ts +19 -10
- package/dist/adapters/node-test/run-isolated.js +68 -52
- package/dist/adapters/node-test/run-test-file.d.ts +12 -4
- package/dist/adapters/node-test/run-test-file.js +18 -14
- package/dist/adapters/node-test/run-test-process.d.ts +30 -13
- package/dist/adapters/node-test/run-test-process.js +38 -40
- package/dist/adapters/node-test/start-node-test-session.d.ts +10 -2
- package/dist/adapters/node-test/start-node-test-session.js +90 -84
- package/dist/adapters/node-test/start-test-process.d.ts +30 -0
- package/dist/adapters/node-test/start-test-process.js +27 -0
- package/dist/adapters/node-test/types/node-test-handle.d.ts +14 -1
- package/dist/adapters/node-test/types/process-watch.d.ts +4 -3
- package/dist/adapters/node-test/types/spare-processes.d.ts +20 -0
- package/dist/adapters/node-test/types/test-process-outcome.d.ts +8 -1
- package/dist/adapters/shared/allows-spares.d.ts +11 -0
- package/dist/adapters/shared/allows-spares.js +23 -0
- package/dist/adapters/shared/create-environment-proxy.d.ts +4 -3
- package/dist/adapters/shared/create-input-filter.d.ts +17 -14
- package/dist/adapters/shared/create-input-filter.js +2 -2
- package/dist/adapters/shared/enable-compile-cache.d.ts +32 -0
- package/dist/adapters/shared/enable-compile-cache.js +7 -0
- package/dist/adapters/shared/find-tsconfig-property.d.ts +13 -0
- package/dist/adapters/shared/find-tsconfig-property.js +6 -0
- package/dist/adapters/shared/get-spare-limit.d.ts +10 -0
- package/dist/adapters/shared/get-spare-limit.js +5 -0
- package/dist/adapters/shared/index-environment-hashes.d.ts +2 -2
- package/dist/adapters/shared/index-environment-hashes.js +5 -13
- package/dist/adapters/{node-test → shared}/list-flag-values.d.ts +2 -1
- package/dist/adapters/shared/list-flag-values.js +10 -0
- package/dist/adapters/shared/list-tsconfig-files.d.ts +14 -5
- package/dist/adapters/shared/list-tsconfig-files.js +15 -13
- package/dist/adapters/shared/parse-tsconfig.d.ts +10 -0
- package/dist/adapters/shared/parse-tsconfig.js +19 -0
- package/dist/adapters/shared/read-flag-name.d.ts +9 -0
- package/dist/adapters/shared/read-flag-name.js +5 -0
- package/dist/adapters/shared/read-node-options.d.ts +11 -0
- package/dist/adapters/shared/read-node-options.js +6 -0
- package/dist/adapters/shared/read-prefork-switch.d.ts +10 -0
- package/dist/adapters/shared/read-prefork-switch.js +5 -0
- package/dist/adapters/shared/read-tsconfig-extends.d.ts +2 -5
- package/dist/adapters/shared/read-tsconfig-extends.js +16 -31
- package/dist/adapters/shared/read-tsconfig-references.d.ts +12 -0
- package/dist/adapters/shared/read-tsconfig-references.js +13 -0
- package/dist/adapters/shared/track-file-reads.d.ts +13 -12
- package/dist/adapters/shared/track-file-reads.js +71 -71
- package/dist/adapters/shared/track-process-group.d.ts +2 -1
- package/dist/adapters/shared/track-process-group.js +7 -2
- package/dist/adapters/vitest/build-isolated-facts.d.ts +4 -3
- package/dist/adapters/vitest/collect-dependencies.d.ts +11 -5
- package/dist/adapters/vitest/collect-dependencies.js +36 -27
- package/dist/adapters/vitest/configure-project.d.ts +3 -2
- package/dist/adapters/vitest/configure-project.js +1 -1
- package/dist/adapters/vitest/create-forks-pool.d.ts +34 -7
- package/dist/adapters/vitest/create-forks-pool.js +102 -24
- package/dist/adapters/vitest/create-interleaved-sequencer.d.ts +3 -2
- package/dist/adapters/vitest/drop-signal-listeners.d.ts +14 -0
- package/dist/adapters/vitest/drop-signal-listeners.js +15 -0
- package/dist/adapters/vitest/get-cache-inputs.d.ts +3 -1
- package/dist/adapters/vitest/get-cache-inputs.js +43 -28
- package/dist/adapters/vitest/get-module-file.d.ts +3 -5
- package/dist/adapters/vitest/get-module-file.js +1 -1
- package/dist/adapters/vitest/get-spare-key.d.ts +15 -0
- package/dist/adapters/vitest/get-spare-key.js +15 -0
- package/dist/adapters/vitest/index.d.ts +2 -1
- package/dist/adapters/vitest/index.js +1 -0
- package/dist/adapters/vitest/is-virtual-module.d.ts +1 -2
- package/dist/adapters/vitest/is-virtual-module.js +1 -1
- package/dist/adapters/vitest/list-script-defines.d.ts +13 -0
- package/dist/adapters/vitest/list-script-defines.js +22 -0
- package/dist/adapters/vitest/read-unit-inputs.d.ts +2 -1
- package/dist/adapters/vitest/run-dry.js +1 -1
- package/dist/adapters/vitest/run-plan.d.ts +10 -8
- package/dist/adapters/vitest/run-plan.js +1 -1
- package/dist/adapters/vitest/run-specifications.d.ts +9 -2
- package/dist/adapters/vitest/run-specifications.js +22 -12
- package/dist/adapters/vitest/runner.d.ts +60 -29
- package/dist/adapters/vitest/runner.js +109 -86
- package/dist/adapters/vitest/start-vitest-session.d.ts +5 -1
- package/dist/adapters/vitest/start-vitest-session.js +64 -59
- package/dist/adapters/vitest/stop-hung-worker.d.ts +11 -4
- package/dist/adapters/vitest/stop-hung-worker.js +20 -7
- package/dist/adapters/vitest/types/mootant-forks-pool.d.ts +47 -0
- package/dist/adapters/vitest/types/vitest-session-state.d.ts +9 -8
- package/dist/adapters/vitest/types/vitest-worker.d.ts +48 -33
- package/dist/adapters/vitest/wait-for-workers.d.ts +5 -2
- package/dist/adapters/vitest/wait-for-workers.js +15 -15
- package/dist/adapters/vitest/worker/track-meta-defines.d.ts +39 -0
- package/dist/adapters/vitest/worker/track-meta-defines.js +23 -0
- package/dist/adapters/vitest/worker/track-values.d.ts +38 -0
- package/dist/adapters/vitest/worker/track-values.js +45 -0
- package/dist/adapters/vitest/worker/value-prefixes.d.ts +12 -0
- package/dist/adapters/vitest/worker/value-prefixes.js +6 -0
- package/dist/adapters/vitest/worker/wait-for-turn.d.ts +8 -6
- package/dist/adapters/vitest/worker/watch-property.d.ts +17 -0
- package/dist/adapters/vitest/worker/watch-property.js +27 -0
- package/dist/cli/create-run-progress.d.ts +8 -1
- package/dist/cli/create-run-progress.js +4 -1
- package/dist/cli/ensure-exit.d.ts +11 -0
- package/dist/cli/ensure-exit.js +15 -0
- package/dist/cli/html/build-html-report.js +1 -0
- package/dist/cli/html/client/main.js +1 -1
- package/dist/cli/html/client/render-overview.d.ts +3 -3
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +3 -2
- package/dist/cli/parse-arguments.d.ts +4 -0
- package/dist/cli/parse-arguments.js +4 -1
- package/dist/cli/report/build-run-report.js +1 -0
- package/dist/cli/report/format-command.d.ts +5 -0
- package/dist/cli/report/format-command.js +1 -1
- package/dist/cli/report/format-run-text-report.d.ts +5 -4
- package/dist/cli/report/format-run-text-report.js +10 -10
- package/dist/cli/report/slim-run-report.d.ts +10 -10
- package/dist/cli/report/slim-run-report.js +1 -0
- package/dist/cli/run-mutation.d.ts +5 -1
- package/dist/cli/run-mutation.js +32 -24
- package/dist/cli/terminal/create-spinner.d.ts +1 -2
- package/dist/cli/terminal/create-spinner.js +23 -32
- package/dist/cli/watch-interrupts.d.ts +41 -0
- package/dist/cli/watch-interrupts.js +32 -0
- package/dist/core/cache/apply-cached-units.d.ts +8 -7
- package/dist/core/cache/build-hash.d.ts +9 -0
- package/dist/core/cache/build-hash.js +2 -0
- package/dist/core/cache/cache-version.d.ts +4 -4
- package/dist/core/cache/check-dry-snapshot.d.ts +25 -0
- package/dist/core/cache/check-dry-snapshot.js +13 -0
- package/dist/core/cache/create-dry-reuse-miss.d.ts +12 -0
- package/dist/core/cache/create-dry-reuse-miss.js +7 -0
- package/dist/core/cache/create-dry-snapshot.d.ts +71 -0
- package/dist/core/cache/create-dry-snapshot.js +27 -0
- package/dist/core/cache/create-run-cache.d.ts +20 -2
- package/dist/core/cache/create-run-cache.js +31 -22
- package/dist/core/cache/create-snapshot-session.d.ts +12 -0
- package/dist/core/cache/create-snapshot-session.js +19 -0
- package/dist/core/cache/get-build-id.d.ts +11 -0
- package/dist/core/cache/get-build-id.js +7 -0
- package/dist/core/cache/get-cache-path.d.ts +1 -1
- package/dist/core/cache/get-cache-path.js +1 -1
- package/dist/core/cache/get-dry-snapshot-key.d.ts +47 -0
- package/dist/core/cache/get-dry-snapshot-key.js +43 -0
- package/dist/core/cache/get-dry-snapshot-path.d.ts +9 -0
- package/dist/core/cache/get-dry-snapshot-path.js +5 -0
- package/dist/core/cache/get-environment-key.d.ts +9 -4
- package/dist/core/cache/get-environment-key.js +3 -2
- package/dist/core/cache/get-test-file-keys.d.ts +2 -1
- package/dist/core/cache/get-test-file-keys.js +11 -10
- package/dist/core/cache/hash-files.d.ts +8 -7
- package/dist/core/cache/hash-files.js +17 -11
- package/dist/core/cache/hash-project-tree.d.ts +22 -0
- package/dist/core/cache/hash-project-tree.js +69 -0
- package/dist/core/cache/is-dry-reuse-miss.d.ts +8 -0
- package/dist/core/cache/is-dry-reuse-miss.js +4 -0
- package/dist/core/cache/list-file-hashes.d.ts +4 -0
- package/dist/core/cache/list-file-hashes.js +5 -2
- package/dist/core/cache/list-install-states.d.ts +12 -0
- package/dist/core/cache/list-install-states.js +19 -0
- package/dist/core/cache/list-variable-hashes.d.ts +15 -0
- package/dist/core/cache/list-variable-hashes.js +14 -0
- package/dist/core/cache/prepare-run-cache.d.ts +48 -22
- package/dist/core/cache/prepare-run-cache.js +86 -73
- package/dist/core/cache/read-dry-snapshot.d.ts +10 -0
- package/dist/core/cache/read-dry-snapshot.js +15 -0
- package/dist/core/cache/read-run-cache.js +6 -2
- package/dist/core/cache/save-dry-snapshot.d.ts +34 -0
- package/dist/core/cache/save-dry-snapshot.js +32 -0
- package/dist/core/cache/volatile-variables.d.ts +7 -0
- package/dist/core/cache/volatile-variables.js +11 -0
- package/dist/core/cache/write-run-cache.js +1 -1
- package/dist/core/config/load-typescript-config.d.ts +6 -1
- package/dist/core/config/load-typescript-config.js +26 -10
- package/dist/core/config/prepare-run.d.ts +7 -3
- package/dist/core/config/prepare-run.js +1 -0
- package/dist/core/config/resolve-run-settings.d.ts +3 -2
- package/dist/core/config/resolve-run-settings.js +1 -0
- package/dist/core/config/validate-config.js +3 -2
- package/dist/core/files/get-package-manifest.d.ts +12 -0
- package/dist/core/files/get-package-manifest.js +7 -0
- package/dist/core/generate/collect-candidates.d.ts +5 -1
- package/dist/core/generate/collect-candidates.js +125 -97
- package/dist/core/generate/generate-file-mutants.js +6 -5
- package/dist/core/index.d.ts +18 -0
- package/dist/core/mutators/shared/get-branch-copy-skip.d.ts +2 -2
- package/dist/core/mutators/shared/get-comparison-plan.d.ts +2 -2
- package/dist/core/mutators/shared/get-default-option-skip.d.ts +2 -2
- package/dist/core/mutators/shared/get-group-constant.d.ts +2 -2
- package/dist/core/mutators/shared/get-literal-skip.d.ts +3 -3
- package/dist/core/mutators/shared/get-loop-running-skip.d.ts +2 -2
- package/dist/core/mutators/shared/get-nullish-swap-skip.d.ts +2 -2
- package/dist/core/mutators/shared/get-or-default-skip.d.ts +2 -2
- package/dist/core/mutators/shared/get-owned-constants.d.ts +2 -2
- package/dist/core/mutators/shared/leave-now-skip.d.ts +2 -2
- package/dist/core/mutators/shared/no-op-callback-skip.d.ts +2 -2
- package/dist/core/plugins/create-mutator-registry.d.ts +4 -2
- package/dist/core/plugins/create-mutator-registry.js +15 -5
- package/dist/core/plugins/validate-plugin.d.ts +3 -3
- package/dist/core/plugins/validate-plugin.js +32 -10
- package/dist/core/regex/collect-pattern-changes.d.ts +2 -2
- package/dist/core/regex/create-regex-replacement.d.ts +2 -2
- package/dist/core/run/apply-isolated-result.d.ts +22 -14
- package/dist/core/run/apply-isolated-result.js +45 -26
- package/dist/core/run/count-run.d.ts +2 -1
- package/dist/core/run/create-run-state.d.ts +5 -0
- package/dist/core/run/create-run-state.js +1 -0
- package/dist/core/run/create-work-directory.d.ts +4 -1
- package/dist/core/run/create-work-directory.js +15 -12
- package/dist/core/run/decide-evidence.d.ts +4 -3
- package/dist/core/run/get-unit-evidence.d.ts +13 -7
- package/dist/core/run/get-unit-evidence.js +1 -1
- package/dist/core/run/guard-session.d.ts +18 -0
- package/dist/core/run/guard-session.js +30 -0
- package/dist/core/run/live-work-directories.d.ts +5 -0
- package/dist/core/run/live-work-directories.js +2 -0
- package/dist/core/run/read-isolated-unit.d.ts +6 -3
- package/dist/core/run/read-isolated-unit.js +77 -38
- package/dist/core/run/remove-live-work-directories.d.ts +7 -0
- package/dist/core/run/remove-live-work-directories.js +12 -0
- package/dist/core/run/run-isolated-rounds.d.ts +16 -12
- package/dist/core/run/run-isolated-rounds.js +3 -2
- package/dist/core/run/validate-adapter.d.ts +1 -1
- package/dist/core/run/validate-adapter.js +1 -1
- package/dist/core/run-mutants.d.ts +34 -2
- package/dist/core/run-mutants.js +356 -216
- package/dist/core/skips/skip-rules.d.ts +3 -1
- package/dist/package.js +1 -1
- package/dist/types/adapter/adapter-context.d.ts +20 -0
- package/dist/types/adapter/adapter-session.d.ts +2 -1
- package/dist/types/adapter/cache-inputs.d.ts +3 -2
- package/dist/types/adapter/dry-file.d.ts +4 -2
- package/dist/types/adapter/isolated-plan.d.ts +2 -1
- package/dist/types/adapter/isolated-result.d.ts +3 -1
- package/dist/types/adapter/run-inputs.d.ts +5 -4
- package/dist/types/adapter/test-adapter.d.ts +7 -0
- package/dist/types/cache/cache-entry.d.ts +9 -7
- package/dist/types/cache/cached-inputs.d.ts +2 -2
- package/dist/types/cache/dry-snapshot.d.ts +76 -0
- package/dist/types/cache/project-tree.d.ts +16 -0
- package/dist/types/cache/run-cache-file.d.ts +1 -1
- package/dist/types/cache/run-cache.d.ts +6 -5
- package/dist/types/config/plugin.d.ts +11 -2
- package/dist/types/config/run-config.d.ts +10 -0
- package/dist/types/config/run-settings.d.ts +6 -0
- package/dist/types/mutant/core-note.d.ts +12 -0
- package/dist/types/mutant/diagnostic.d.ts +1 -0
- package/dist/types/mutant/registered-skip-rule.d.ts +11 -0
- package/dist/types/mutant/skip-note.d.ts +7 -6
- package/dist/types/mutant/skip-rule-id.d.ts +3 -2
- package/dist/types/mutant/skip-rule.d.ts +2 -1
- package/dist/types/mutant/skipped-candidate.d.ts +14 -7
- package/dist/types/mutant/skipped-mutant.d.ts +6 -6
- package/dist/types/mutator/mutator.d.ts +3 -2
- package/dist/types/mutator/registered-mutator.d.ts +8 -0
- package/dist/types/regex/regex-change.d.ts +2 -2
- package/dist/types/report/html-report.d.ts +3 -2
- package/dist/types/report/list-report-skipped.d.ts +3 -2
- package/dist/types/report/run-report.d.ts +11 -2
- package/dist/types/report/slim-run-report.d.ts +1 -1
- package/dist/types/run/isolated-evidence.d.ts +3 -2
- package/dist/types/run/isolated-reason.d.ts +2 -1
- package/dist/types/run/run-durations.d.ts +8 -3
- package/dist/types/run/run-event.d.ts +10 -7
- package/dist/types/run/run-result.d.ts +11 -2
- package/dist/types/run/run-state.d.ts +21 -0
- package/dist/types/run/try-cause.d.ts +2 -1
- package/package.json +1 -1
- package/readme.md +85 -68
- package/skills/mootant/SKILL.md +36 -19
- package/skills/mootant/references/mutators.md +29 -23
- package/dist/adapters/node-test/list-flag-values.js +0 -9
- /package/dist/adapters/{node-test → shared}/loader-flags.d.ts +0 -0
- /package/dist/adapters/{node-test → shared}/loader-flags.js +0 -0
- /package/dist/{adapters/shared → core/files}/list-package-files.d.ts +0 -0
- /package/dist/{adapters/shared → core/files}/list-package-files.js +0 -0
- /package/dist/{adapters/shared → core/files}/read-package-type.d.ts +0 -0
- /package/dist/{adapters/shared → core/files}/read-package-type.js +0 -0
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
* Registry of the rules that skip a candidate, keyed by rule id: the ownership
|
|
3
3
|
* (O) and redundancy (R) labels of the catalog, and short kebab-case names for
|
|
4
4
|
* the other rules. Each rule has one category and is a heuristic or not; a skip
|
|
5
|
-
* names only its rule, so ids, categories and flags stay consistent.
|
|
5
|
+
* names only its rule, so ids, categories and flags stay consistent. Built-in
|
|
6
|
+
* mutators and the collection name these rules; a mutator of a plugin names
|
|
7
|
+
* them too, after the skip rules of its plugin.
|
|
6
8
|
*/
|
|
7
9
|
export declare let skipRules: {
|
|
8
10
|
'canonical-falsy-default': {
|
package/dist/package.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e = "0.
|
|
1
|
+
const e = "0.3.0";
|
|
2
2
|
export { e as version };
|
|
@@ -37,12 +37,32 @@ export interface AdapterContext {
|
|
|
37
37
|
*/
|
|
38
38
|
concurrency: number | null
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Whether isolated units of one test file may run at the same time, each in a
|
|
42
|
+
* worker of its own: the project's tests must not rely on a test file never
|
|
43
|
+
* running twice at once, as with a fixed file, port or database. False or
|
|
44
|
+
* omitted runs them one after another, in plan order. Only an adapter with
|
|
45
|
+
* `TestAdapter.parallelUnits` gets true.
|
|
46
|
+
*/
|
|
47
|
+
parallelUnits?: boolean
|
|
48
|
+
|
|
40
49
|
/**
|
|
41
50
|
* Directory for files of this run (plans, results, heartbeats); the core
|
|
42
51
|
* creates it and removes it after `close`.
|
|
43
52
|
*/
|
|
44
53
|
workDirectory: string
|
|
45
54
|
|
|
55
|
+
/**
|
|
56
|
+
* Aborted once the run is interrupted, such as on a signal to the command
|
|
57
|
+
* line. From then on the adapter starts no test process and stops those that
|
|
58
|
+
* run, so the running call ends soon; the core waits for that call, drops
|
|
59
|
+
* what it gives, then calls `close` and calls nothing else. The command line
|
|
60
|
+
* gives this cleanup 5 seconds before it ends the process anyway, leaving
|
|
61
|
+
* what the adapter did not remove. Optional; an adapter that ignores it lets
|
|
62
|
+
* its running call go on until then.
|
|
63
|
+
*/
|
|
64
|
+
signal?: AbortSignal
|
|
65
|
+
|
|
46
66
|
/**
|
|
47
67
|
* Project root: the directory of the mootant configuration, else the working
|
|
48
68
|
* directory.
|
|
@@ -14,7 +14,8 @@ export interface AdapterSession {
|
|
|
14
14
|
* Executes isolated units in one run. Several units may share a test file;
|
|
15
15
|
* they run one after another, in plan order, never at the same time, since a
|
|
16
16
|
* plain run of the test runner never runs a test file twice at once and tests
|
|
17
|
-
* may rely on it (a fixed file, port or database)
|
|
17
|
+
* may rely on it (a fixed file, port or database), unless the context allows
|
|
18
|
+
* parallel units (`AdapterContext.parallelUnits`).
|
|
18
19
|
*/
|
|
19
20
|
runIsolated(plan: IsolatedPlan): Promise<IsolatedResult>
|
|
20
21
|
|
|
@@ -7,8 +7,9 @@ export interface CacheInputs {
|
|
|
7
7
|
* Hashes of the values of the environment variables test files see, by name,
|
|
8
8
|
* for each project of the test runner by name (see `DryFile.project`), and
|
|
9
9
|
* under `*` a hash of all of them but those that change from one shell to
|
|
10
|
-
* another; a variable that is not set has no entry.
|
|
11
|
-
*
|
|
10
|
+
* another; a variable that is not set has no entry. Other values have their
|
|
11
|
+
* hashes under the names `DryFile.environment` gives them. Without it,
|
|
12
|
+
* variables test files read count as not set.
|
|
12
13
|
*/
|
|
13
14
|
environment?: Record<string, Record<string, string>>
|
|
14
15
|
|
|
@@ -15,8 +15,10 @@ export interface DryFile {
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Names of the environment variables the test code read in the run, or `*`
|
|
18
|
-
* when it listed them all
|
|
19
|
-
*
|
|
18
|
+
* when it listed them all, and of other values of the test runner it read,
|
|
19
|
+
* under names no variable has, such as `provide=url` for Vitest's
|
|
20
|
+
* `inject('url')`; values come from `CacheInputs.environment`. Omitted when
|
|
21
|
+
* the adapter does not track them.
|
|
20
22
|
*/
|
|
21
23
|
environment?: string[]
|
|
22
24
|
|
|
@@ -32,7 +32,8 @@ export interface IsolatedUnit {
|
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Units of one isolated run. Several units may share a test file; they never
|
|
35
|
-
* run at the same time
|
|
35
|
+
* run at the same time, unless the context allows parallel units
|
|
36
|
+
* (`AdapterContext.parallelUnits`).
|
|
36
37
|
*/
|
|
37
38
|
export interface IsolatedPlan {
|
|
38
39
|
/**
|
|
@@ -74,7 +74,9 @@ export interface IsolatedFacts {
|
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* What an isolated run reported; a unit without facts is planned once more,
|
|
77
|
-
* then becomes `Error
|
|
77
|
+
* then becomes `Error`, and so is a unit in which something else stopped the
|
|
78
|
+
* tests that reach its mutant before they got to it, such as a failed suite
|
|
79
|
+
* hook.
|
|
78
80
|
*/
|
|
79
81
|
export interface IsolatedResult {
|
|
80
82
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* What a run of a test file read besides the code of its mutant: the files it
|
|
3
|
-
* depended on and the environment variables it read. The cache
|
|
4
|
-
* with the dry run of the test file, and evidence that read more
|
|
5
|
-
* while those extra inputs are unchanged.
|
|
3
|
+
* depended on and the environment variables and other values it read. The cache
|
|
4
|
+
* compares them with the dry run of the test file, and evidence that read more
|
|
5
|
+
* is reused only while those extra inputs are unchanged.
|
|
6
6
|
*/
|
|
7
7
|
export interface RunInputs {
|
|
8
8
|
/**
|
|
@@ -14,7 +14,8 @@ export interface RunInputs {
|
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Names of the environment variables the test code read, or `*` when it
|
|
17
|
-
* listed them all
|
|
17
|
+
* listed them all, and of other values, as in `DryFile.environment`; values
|
|
18
|
+
* come from `CacheInputs.environment`.
|
|
18
19
|
*/
|
|
19
20
|
environment: string[]
|
|
20
21
|
}
|
|
@@ -15,6 +15,13 @@ export interface TestAdapter {
|
|
|
15
15
|
*/
|
|
16
16
|
start(context: AdapterContext): Promise<AdapterSession>
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Whether the adapter runs isolated units of one test file at the same time
|
|
20
|
+
* when the context allows it (`AdapterContext.parallelUnits`). Optional;
|
|
21
|
+
* without it the core never allows it, and a run that asks for it notes so.
|
|
22
|
+
*/
|
|
23
|
+
parallelUnits?: boolean
|
|
24
|
+
|
|
18
25
|
/**
|
|
19
26
|
* Version of the adapter itself, part of the cache key; the version of the
|
|
20
27
|
* test runner is `AdapterSession.version`. Optional.
|
|
@@ -5,11 +5,12 @@ import { TryCause } from '../run/try-cause.js';
|
|
|
5
5
|
*/
|
|
6
6
|
export interface CacheEntry {
|
|
7
7
|
/**
|
|
8
|
-
* `Killed` with the test of the kill
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* `Killed` with the test of the kill; `Timeout` for an isolated unit over its
|
|
9
|
+
* raised hit limit; or `Survived` for an isolated unit that reached the
|
|
10
|
+
* mutant and passed, or for a batch try that passed, whether it reached the
|
|
11
|
+
* mutant or not.
|
|
11
12
|
*/
|
|
12
|
-
status: 'Survived' | 'Killed'
|
|
13
|
+
status: 'Survived' | 'Timeout' | 'Killed'
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Path the evidence came from; batch entries are only reused in fast mode.
|
|
@@ -24,12 +25,12 @@ export interface CacheEntry {
|
|
|
24
25
|
incremental: string | null
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
|
-
* First line of the failure of a kill, or null.
|
|
28
|
+
* First line of the failure of a kill or a timeout, or null.
|
|
28
29
|
*/
|
|
29
30
|
message: string | null
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
|
-
* How the kill was detected, or null for `Survived`.
|
|
33
|
+
* How the kill or the timeout was detected, or null for `Survived`.
|
|
33
34
|
*/
|
|
34
35
|
cause: TryCause | null
|
|
35
36
|
|
|
@@ -40,7 +41,8 @@ export interface CacheEntry {
|
|
|
40
41
|
inputs: string | null
|
|
41
42
|
|
|
42
43
|
/**
|
|
43
|
-
* Id of the test that failed, or null (load-time
|
|
44
|
+
* Id of the test that failed or ran into the hit limit, or null (load-time
|
|
45
|
+
* kills and timeouts, `Survived`).
|
|
44
46
|
*/
|
|
45
47
|
test: string | null
|
|
46
48
|
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export interface CachedInputs {
|
|
7
7
|
/**
|
|
8
|
-
* Names of environment variables
|
|
9
|
-
*
|
|
8
|
+
* Names of environment variables, or of other values (`DryFile.environment`),
|
|
9
|
+
* with the hash of their values, or null for one that was not set, sorted.
|
|
10
10
|
*/
|
|
11
11
|
environment: [string, string | null][]
|
|
12
12
|
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { DryRunResult } from '../adapter/dry-run-result.js';
|
|
2
|
+
import { CacheInputs } from '../adapter/cache-inputs.js';
|
|
3
|
+
import { Diagnostic } from '../mutant/diagnostic.js';
|
|
4
|
+
/**
|
|
5
|
+
* What a run saw of its test runner up to the end of its dry phase, saved next
|
|
6
|
+
* to the cache file, so that a later run whose inputs are all unchanged can
|
|
7
|
+
* decide its mutants from cached verdicts without starting the test runner.
|
|
8
|
+
* Paths are absolute: the key includes the project root.
|
|
9
|
+
*/
|
|
10
|
+
export interface DrySnapshot {
|
|
11
|
+
/**
|
|
12
|
+
* What the session reported besides its runs: its version, workers and
|
|
13
|
+
* warnings, and what verdicts depend on beyond each test file, as
|
|
14
|
+
* `prepareRunCache` asked it once (`AdapterSession.cacheInputs`).
|
|
15
|
+
*/
|
|
16
|
+
session: {
|
|
17
|
+
diagnostics: Diagnostic[]
|
|
18
|
+
version: string | null
|
|
19
|
+
workers: number | null
|
|
20
|
+
inputs: CacheInputs
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Outcome of the dry phase: the final dry run, the messages of the files
|
|
25
|
+
* whose mutants get no verdict, by display path, and the diagnostics of the
|
|
26
|
+
* phase.
|
|
27
|
+
*/
|
|
28
|
+
phase: {
|
|
29
|
+
errors: [string, string][]
|
|
30
|
+
diagnostics: Diagnostic[]
|
|
31
|
+
dry: DryRunResult
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Environment variables of the main process as the run started, before the
|
|
36
|
+
* test runner could set any (`listVariableHashes`): each one test code read,
|
|
37
|
+
* in the dry run or in a unit whose evidence the cache holds, and `*` for all
|
|
38
|
+
* but those that change from shell to shell, with the hash of the value, or
|
|
39
|
+
* null when unset, as the names of other values (`DryFile.environment`)
|
|
40
|
+
* always are.
|
|
41
|
+
*/
|
|
42
|
+
variables: [string, string | null][]
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Files the dry run and the cache keys depended on, with the hash of their
|
|
46
|
+
* contents after the dry run, or null for a missing one: the files of
|
|
47
|
+
* `session.inputs`, the lockfile with the files that tell what was installed
|
|
48
|
+
* (`listInstallStates`), `package.json`, the `.env`, `tsconfig` and
|
|
49
|
+
* `jsconfig` files of the root, and every test file of the dry run with its
|
|
50
|
+
* dependencies, inside the root or not, under `node_modules` too.
|
|
51
|
+
*/
|
|
52
|
+
files: [string, string | null][]
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Test files and setup files of the session (`AdapterSession.listTestFiles`).
|
|
56
|
+
*/
|
|
57
|
+
testFiles: string[]
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Version of the format (`CACHE_VERSION`).
|
|
61
|
+
*/
|
|
62
|
+
version: number
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Hash of everything under the project root (`hashProjectTree`), taken before
|
|
66
|
+
* the test runner started and checked again before saving: a file added,
|
|
67
|
+
* removed or changed anywhere, such as a new test file or a helper of a test
|
|
68
|
+
* file the dry run did not run, makes the snapshot stale.
|
|
69
|
+
*/
|
|
70
|
+
tree: string
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Hash of what the dry run was asked to do (`getDrySnapshotKey`).
|
|
74
|
+
*/
|
|
75
|
+
key: string
|
|
76
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything under the project root as `hashProjectTree` saw it.
|
|
3
|
+
*/
|
|
4
|
+
export interface ProjectTree {
|
|
5
|
+
/**
|
|
6
|
+
* Each path under the root, relative to it with `/` separators, with what it
|
|
7
|
+
* is as text: a directory, a file with the hash of its contents, or a
|
|
8
|
+
* symbolic link with its target.
|
|
9
|
+
*/
|
|
10
|
+
entries: ReadonlyMap<string, string>
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* SHA-256 in hex over every entry.
|
|
14
|
+
*/
|
|
15
|
+
hash: string
|
|
16
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CachedInputs } from './cached-inputs.js';
|
|
2
2
|
import { CacheEntry } from './cache-entry.js';
|
|
3
3
|
/**
|
|
4
|
-
* Content of the cache file, `node_modules/.cache/mootant/run-
|
|
4
|
+
* Content of the cache file, `node_modules/.cache/mootant/run-v7.json`.
|
|
5
5
|
*/
|
|
6
6
|
export interface RunCacheFile {
|
|
7
7
|
/**
|
|
@@ -40,8 +40,9 @@ export interface RunCache {
|
|
|
40
40
|
recordBatch(mutant: MutantState, test: string, evidence: CacheEvidence): void
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
* Records the evidence of an isolated unit: a kill
|
|
44
|
-
* what the unit read. Kills by a crash,
|
|
43
|
+
* Records the final evidence of an isolated unit: a kill, a timeout or a
|
|
44
|
+
* reached pass, with what the unit read. Kills by a crash, errors, and
|
|
45
|
+
* timeouts other than one by the hit limit outside fast mode are not stored,
|
|
45
46
|
* and neither is anything about a test file without a key or a unit whose
|
|
46
47
|
* inputs are unknown.
|
|
47
48
|
*/
|
|
@@ -107,7 +108,7 @@ export interface CacheEvidence<
|
|
|
107
108
|
inputs: RunInputs | undefined | null
|
|
108
109
|
|
|
109
110
|
/**
|
|
110
|
-
* A kill or a pass.
|
|
111
|
+
* A kill, a timeout or a pass.
|
|
111
112
|
*/
|
|
112
113
|
verdict: Verdict
|
|
113
114
|
}
|
|
@@ -118,8 +119,8 @@ export interface CacheEvidence<
|
|
|
118
119
|
*/
|
|
119
120
|
export interface PendingInputs {
|
|
120
121
|
/**
|
|
121
|
-
* Names of environment variables
|
|
122
|
-
*
|
|
122
|
+
* Names of environment variables, or of other values, with the hash of their
|
|
123
|
+
* values, or null for one that is not set, sorted.
|
|
123
124
|
*/
|
|
124
125
|
environment: [string, string | null][]
|
|
125
126
|
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
+
import { SkipRule } from '../mutant/skip-rule.js';
|
|
1
2
|
import { Mutator } from '../mutator/mutator.js';
|
|
2
3
|
import { Preset } from './preset.js';
|
|
3
4
|
/**
|
|
4
|
-
* Package of mutators and
|
|
5
|
-
* other plugins get a namespace that prefixes their ids.
|
|
5
|
+
* Package of mutators, presets and skip rules. Built-in mutators form the core
|
|
6
|
+
* plugin; other plugins get a namespace that prefixes their ids.
|
|
6
7
|
*/
|
|
7
8
|
export interface Plugin {
|
|
9
|
+
/**
|
|
10
|
+
* Rules that the skips of the plugin's mutators name, keyed by kebab-case
|
|
11
|
+
* name; reports give a rule the id `namespace/name`. A skip may also name a
|
|
12
|
+
* built-in rule that the plugin does not declare. The core plugin has none:
|
|
13
|
+
* its mutators name the built-in rules.
|
|
14
|
+
*/
|
|
15
|
+
skipRules?: Record<string, SkipRule>
|
|
16
|
+
|
|
8
17
|
/**
|
|
9
18
|
* Mutators keyed by kebab-case name.
|
|
10
19
|
*/
|
|
@@ -40,6 +40,16 @@ export interface RunConfig {
|
|
|
40
40
|
*/
|
|
41
41
|
html?: boolean | string
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Parallel units: run one test file for several mutants at once, each run in
|
|
45
|
+
* a process of its own, with Vitest and Node Test; faster when a few test
|
|
46
|
+
* files cover most mutants, but runs of one test file that share something
|
|
47
|
+
* outside their processes, such as a fixed file, port or database, may give
|
|
48
|
+
* false verdicts. False when omitted, so a test file runs for one mutant at a
|
|
49
|
+
* time, as a plain run never runs a test file twice at once.
|
|
50
|
+
*/
|
|
51
|
+
parallelUnits?: boolean
|
|
52
|
+
|
|
43
53
|
/**
|
|
44
54
|
* Incremental mode: reuse a cached verdict while the declaration of its
|
|
45
55
|
* mutant, what that uses in its file and what its test file reads outside the
|
|
@@ -14,6 +14,12 @@ export interface RunSettings {
|
|
|
14
14
|
*/
|
|
15
15
|
threshold: number | null
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Whether parallel units were asked for, which the run uses only with an
|
|
19
|
+
* adapter that runs them.
|
|
20
|
+
*/
|
|
21
|
+
parallelUnits: boolean
|
|
22
|
+
|
|
17
23
|
/**
|
|
18
24
|
* How try limits grow from the dry run.
|
|
19
25
|
*/
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SkipRuleId } from './skip-rule-id.js';
|
|
2
|
+
import { SkipNote } from './skip-note.js';
|
|
3
|
+
/**
|
|
4
|
+
* Skip note of a built-in mutator or of the collection: its rule is a built-in
|
|
5
|
+
* id, so that a rule the registry does not have fails to compile.
|
|
6
|
+
*/
|
|
7
|
+
export interface CoreNote extends SkipNote {
|
|
8
|
+
/**
|
|
9
|
+
* Id of the rule in the registry.
|
|
10
|
+
*/
|
|
11
|
+
rule: SkipRuleId
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SkipRule } from './skip-rule.js';
|
|
2
|
+
/**
|
|
3
|
+
* Skip rule with the id that reports give it.
|
|
4
|
+
*/
|
|
5
|
+
export interface RegisteredSkipRule extends SkipRule {
|
|
6
|
+
/**
|
|
7
|
+
* Full id: `namespace/name` for a rule of a plugin, the name itself for a
|
|
8
|
+
* built-in rule.
|
|
9
|
+
*/
|
|
10
|
+
id: string
|
|
11
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Node } from 'oxc-parser';
|
|
2
|
-
import { SkipRuleId } from './skip-rule-id.js';
|
|
3
2
|
/**
|
|
4
3
|
* Why a mutator does not emit a replacement it would otherwise make.
|
|
5
4
|
*/
|
|
@@ -18,13 +17,15 @@ export interface SkipNote {
|
|
|
18
17
|
heuristic?: boolean
|
|
19
18
|
|
|
20
19
|
/**
|
|
21
|
-
*
|
|
22
|
-
* rule is a heuristic.
|
|
20
|
+
* Plain-English reason, worded to follow `skipped: `.
|
|
23
21
|
*/
|
|
24
|
-
|
|
22
|
+
reason: string
|
|
25
23
|
|
|
26
24
|
/**
|
|
27
|
-
*
|
|
25
|
+
* Name of the rule, which gives the category and whether the rule is a
|
|
26
|
+
* heuristic: a key of the `skipRules` of the mutator's plugin, else an id of
|
|
27
|
+
* the registry. A skip with any other rule is a mutator error, and its
|
|
28
|
+
* replacement is dropped.
|
|
28
29
|
*/
|
|
29
|
-
|
|
30
|
+
rule: string
|
|
30
31
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { skipRules } from '../../core/skips/skip-rules.js';
|
|
2
2
|
/**
|
|
3
|
-
* Id of a skip rule of the registry: a catalog label such as
|
|
4
|
-
* short kebab-case name such as `lower-bound`.
|
|
3
|
+
* Id of a built-in skip rule, a key of the registry: a catalog label such as
|
|
4
|
+
* `O3` or `R2`, or a short kebab-case name such as `lower-bound`. Rules of a
|
|
5
|
+
* plugin are not among them.
|
|
5
6
|
*/
|
|
6
7
|
export type SkipRuleId = keyof typeof skipRules
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RegisteredMutator } from '../mutator/registered-mutator.js';
|
|
2
2
|
import { SkipJustifier } from './skip-justifier.js';
|
|
3
|
+
import { SkipCategory } from './skip-category.js';
|
|
3
4
|
import { TextEdit } from '../source/text-edit.js';
|
|
4
|
-
import { SkipRuleId } from './skip-rule-id.js';
|
|
5
5
|
import { MutantKind } from './mutant-kind.js';
|
|
6
6
|
/**
|
|
7
7
|
* Replacement that was considered and not emitted, before it is sorted.
|
|
@@ -25,7 +25,13 @@ export interface SkippedCandidate {
|
|
|
25
25
|
kind: MutantKind | null
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* Category of the skip rule.
|
|
29
|
+
*/
|
|
30
|
+
category: SkipCategory
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Whether the skip rests on a guess: its rule is a heuristic, or the skip
|
|
34
|
+
* also rests on one.
|
|
29
35
|
*/
|
|
30
36
|
heuristic: boolean
|
|
31
37
|
|
|
@@ -41,11 +47,6 @@ export interface SkippedCandidate {
|
|
|
41
47
|
*/
|
|
42
48
|
emission: number
|
|
43
49
|
|
|
44
|
-
/**
|
|
45
|
-
* Id of the skip rule.
|
|
46
|
-
*/
|
|
47
|
-
rule: SkipRuleId
|
|
48
|
-
|
|
49
50
|
/**
|
|
50
51
|
* Plain-English reason of the skip.
|
|
51
52
|
*/
|
|
@@ -61,6 +62,12 @@ export interface SkippedCandidate {
|
|
|
61
62
|
*/
|
|
62
63
|
text: string
|
|
63
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Id of the skip rule: a built-in id, or `namespace/name` for a rule of a
|
|
67
|
+
* plugin.
|
|
68
|
+
*/
|
|
69
|
+
rule: string
|
|
70
|
+
|
|
64
71
|
/**
|
|
65
72
|
* End of the replaced range.
|
|
66
73
|
*/
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { SkipJustifier } from './skip-justifier.js';
|
|
2
2
|
import { SkipCategory } from './skip-category.js';
|
|
3
3
|
import { TextEdit } from '../source/text-edit.js';
|
|
4
|
-
import { SkipRuleId } from './skip-rule-id.js';
|
|
5
4
|
import { MutantKind } from './mutant-kind.js';
|
|
6
5
|
/**
|
|
7
6
|
* Mutation that a mutator or the pipeline considered and did not emit. It has
|
|
@@ -42,11 +41,6 @@ export interface SkippedMutant {
|
|
|
42
41
|
*/
|
|
43
42
|
focus?: TextEdit
|
|
44
43
|
|
|
45
|
-
/**
|
|
46
|
-
* Id of the skip rule.
|
|
47
|
-
*/
|
|
48
|
-
rule: SkipRuleId
|
|
49
|
-
|
|
50
44
|
/**
|
|
51
45
|
* Id of the mutator that considered the mutation.
|
|
52
46
|
*/
|
|
@@ -62,6 +56,12 @@ export interface SkippedMutant {
|
|
|
62
56
|
*/
|
|
63
57
|
start: number
|
|
64
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Id of the skip rule: a built-in id such as `O3` or `lower-bound`, or
|
|
61
|
+
* `namespace/name` for a rule of a plugin.
|
|
62
|
+
*/
|
|
63
|
+
rule: string
|
|
64
|
+
|
|
65
65
|
/**
|
|
66
66
|
* Path of the file relative to the working directory, with `/` separators.
|
|
67
67
|
*/
|
|
@@ -7,8 +7,9 @@ import { MutatorMeta } from './mutator-meta.js';
|
|
|
7
7
|
*/
|
|
8
8
|
export interface Mutator<Options extends object = object> {
|
|
9
9
|
/**
|
|
10
|
-
* Creates the visitors for one
|
|
11
|
-
*
|
|
10
|
+
* Creates the visitors for one program: a file, or a script block or the
|
|
11
|
+
* template of a Vue or Svelte file. Mootant calls it once per program, so the
|
|
12
|
+
* visitors may keep state for that program in the closure.
|
|
12
13
|
*/
|
|
13
14
|
create(context: MutatorContext<Options>): MutatorVisitors
|
|
14
15
|
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
+
import { RegisteredSkipRule } from '../mutant/registered-skip-rule.js';
|
|
1
2
|
import { Mutator } from './mutator.js';
|
|
2
3
|
/**
|
|
3
4
|
* Mutator known to the registry.
|
|
4
5
|
*/
|
|
5
6
|
export interface RegisteredMutator {
|
|
7
|
+
/**
|
|
8
|
+
* Skip rules of the plugin of the mutator, keyed by the name a skip gives,
|
|
9
|
+
* each with its id `namespace/name`, which a skip names before the built-in
|
|
10
|
+
* rules; omitted for a built-in mutator.
|
|
11
|
+
*/
|
|
12
|
+
skipRules?: ReadonlyMap<string, RegisteredSkipRule>
|
|
13
|
+
|
|
6
14
|
/**
|
|
7
15
|
* Module that produces the replacements.
|
|
8
16
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CoreNote } from '../mutant/core-note.js';
|
|
2
2
|
/**
|
|
3
3
|
* Edit of a regular expression pattern that a regex mutator considers, with
|
|
4
4
|
* offsets relative to the pattern.
|
|
@@ -7,7 +7,7 @@ export interface RegexChange {
|
|
|
7
7
|
/**
|
|
8
8
|
* Why the change is not emitted, or null when it is.
|
|
9
9
|
*/
|
|
10
|
-
skip:
|
|
10
|
+
skip: CoreNote | null
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Offset of the first replaced character of the pattern.
|
|
@@ -201,7 +201,8 @@ export interface HtmlReportSkipped {
|
|
|
201
201
|
start: number
|
|
202
202
|
|
|
203
203
|
/**
|
|
204
|
-
* Id of the skip rule, such as `O3
|
|
204
|
+
* Id of the skip rule, such as `O3`, `lower-bound` or, for a rule of a
|
|
205
|
+
* plugin, `namespace/name`.
|
|
205
206
|
*/
|
|
206
207
|
rule: string
|
|
207
208
|
|
|
@@ -282,7 +283,7 @@ export interface HtmlReport {
|
|
|
282
283
|
*/
|
|
283
284
|
export interface HtmlReportMeta extends Pick<
|
|
284
285
|
RunReport,
|
|
285
|
-
'runnerVersion' | 'runner' | 'preset' | 'since' | 'mode'
|
|
286
|
+
'parallelUnits' | 'runnerVersion' | 'runner' | 'preset' | 'since' | 'mode'
|
|
286
287
|
> {
|
|
287
288
|
/**
|
|
288
289
|
* Characters ids are cut to: the shortest that tells apart every listed
|
|
@@ -70,8 +70,9 @@ export interface ListReportSkipped {
|
|
|
70
70
|
line: number
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
|
-
* Id of the skip rule: a catalog label such as `O3` or `R2`,
|
|
74
|
-
* kebab-case name such as `lower-bound` or `duplicate
|
|
73
|
+
* Id of the skip rule: a catalog label such as `O3` or `R2`, a short
|
|
74
|
+
* kebab-case name such as `lower-bound` or `duplicate`, or `namespace/name`
|
|
75
|
+
* for a rule of a plugin.
|
|
75
76
|
*/
|
|
76
77
|
rule: string
|
|
77
78
|
|