mootant 0.1.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/build-dry-file.d.ts +12 -12
- package/dist/adapters/jest/collect-jest-dependencies.d.ts +15 -12
- 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/runner.d.ts +1 -1
- package/dist/adapters/jest/runner.js +1 -1
- 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 +5 -4
- package/dist/adapters/jest/types/unit-worker.d.ts +16 -8
- package/dist/adapters/jest/types/worker-channel.d.ts +7 -0
- package/dist/adapters/jest/types/worker-session.d.ts +6 -7
- package/dist/adapters/jest/worker/boot-worker.d.ts +5 -3
- 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 +24 -17
- package/dist/adapters/jest/worker/vm-setup.js +1 -1
- package/dist/adapters/jest/worker/worker.js +1 -1
- package/dist/adapters/jest/write-worker-session.d.ts +1 -2
- package/dist/adapters/jest/write-worker-session.js +2 -2
- 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 -49
- 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 +19 -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/node-test-record.d.ts +3 -3
- package/dist/adapters/node-test/types/node-test-unit.d.ts +6 -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 +29 -0
- package/dist/adapters/shared/create-input-filter.js +32 -0
- 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-inputs.d.ts +7 -3
- package/dist/adapters/shared/track-file-inputs.js +16 -7
- package/dist/adapters/shared/track-file-reads.d.ts +13 -8
- package/dist/adapters/shared/track-file-reads.js +122 -69
- package/dist/adapters/shared/track-inputs.d.ts +13 -6
- package/dist/adapters/shared/track-inputs.js +7 -7
- package/dist/adapters/shared/track-process-group.d.ts +2 -1
- package/dist/adapters/shared/track-process-group.js +7 -2
- package/dist/adapters/shared/types/file-input-tracking.d.ts +6 -0
- package/dist/adapters/shared/types/input-tracking.d.ts +3 -3
- package/dist/adapters/vitest/build-isolated-facts.d.ts +4 -3
- package/dist/adapters/vitest/collect-dependencies.d.ts +10 -3
- package/dist/adapters/vitest/collect-dependencies.js +36 -26
- 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 +46 -29
- 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 +10 -0
- package/dist/adapters/vitest/is-virtual-module.js +8 -0
- 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-out-files.d.ts +7 -2
- package/dist/adapters/vitest/read-out-files.js +5 -5
- package/dist/adapters/vitest/read-out-records.d.ts +17 -0
- package/dist/adapters/vitest/read-out-records.js +27 -0
- package/dist/adapters/vitest/read-strays.d.ts +20 -0
- package/dist/adapters/vitest/read-strays.js +53 -0
- package/dist/adapters/vitest/read-unit-inputs.d.ts +9 -2
- package/dist/adapters/vitest/read-unit-inputs.js +1 -1
- package/dist/adapters/vitest/run-dry.js +17 -17
- package/dist/adapters/vitest/run-plan.d.ts +10 -6
- package/dist/adapters/vitest/run-plan.js +16 -16
- package/dist/adapters/vitest/run-specifications.d.ts +11 -3
- package/dist/adapters/vitest/run-specifications.js +22 -12
- package/dist/adapters/vitest/runner.d.ts +92 -46
- package/dist/adapters/vitest/runner.js +126 -104
- 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/stray-decisions.d.ts +8 -0
- package/dist/adapters/vitest/types/unit-outcome.d.ts +2 -1
- package/dist/adapters/vitest/types/vitest-session-state.d.ts +9 -8
- package/dist/adapters/vitest/types/vitest-worker.d.ts +118 -32
- 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/encode-stray.d.ts +16 -0
- package/dist/adapters/vitest/worker/encode-stray.js +16 -0
- package/dist/adapters/vitest/worker/intercept-strays.d.ts +26 -0
- package/dist/adapters/vitest/worker/intercept-strays.js +13 -0
- package/dist/adapters/vitest/worker/read-try-facts.d.ts +5 -4
- 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/adapters/vitest/worker/write-out-record.d.ts +2 -2
- 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 +2 -1
- package/dist/cli/html/client/main.js +1 -1
- package/dist/cli/html/client/render-change.d.ts +3 -2
- package/dist/cli/html/client/render-code.d.ts +1 -1
- package/dist/cli/html/client/render-overview.d.ts +3 -3
- package/dist/cli/html/pack-replacement.d.ts +1 -1
- 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-list-report.js +1 -1
- package/dist/cli/report/build-run-report.js +2 -1
- package/dist/cli/report/format-command.d.ts +5 -0
- package/dist/cli/report/format-command.js +1 -1
- package/dist/cli/report/format-file-groups.d.ts +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 +55 -47
- package/dist/cli/terminal/create-spinner.d.ts +2 -3
- package/dist/cli/terminal/create-spinner.js +23 -32
- package/dist/cli/terminal/get-text-style.js +4 -4
- 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 +5 -4
- 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 +11 -6
- package/dist/core/cache/hash-files.js +22 -17
- 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 +64 -16
- package/dist/core/cache/prepare-run-cache.js +109 -62
- 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/save-run-cache.d.ts +8 -7
- package/dist/core/cache/save-run-cache.js +2 -1
- package/dist/core/cache/unknown-hash.d.ts +7 -0
- package/dist/core/cache/unknown-hash.js +2 -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/files/select-changed-mutants.d.ts +11 -6
- package/dist/core/files/select-changed-mutants.js +38 -13
- package/dist/core/generate/apply-solitary-rule.d.ts +8 -5
- package/dist/core/generate/apply-solitary-rule.js +36 -29
- package/dist/core/generate/collect-candidates.d.ts +23 -5
- package/dist/core/generate/collect-candidates.js +202 -92
- package/dist/core/generate/compare-targets.d.ts +14 -0
- package/dist/core/generate/compare-targets.js +6 -0
- package/dist/core/generate/deduplicate-candidates.d.ts +6 -4
- package/dist/core/generate/deduplicate-candidates.js +11 -9
- package/dist/core/generate/find-list-removal.d.ts +20 -0
- package/dist/core/generate/find-list-removal.js +26 -0
- package/dist/core/generate/generate-file-mutants.js +49 -47
- package/dist/core/generate/get-mutant-site.d.ts +18 -0
- package/dist/core/generate/get-mutant-site.js +4 -0
- package/dist/core/generate/get-target.d.ts +14 -0
- package/dist/core/generate/get-target.js +4 -0
- package/dist/core/generate/pick-host.d.ts +10 -0
- package/dist/core/generate/pick-host.js +16 -0
- package/dist/core/generate/validate-replacement.d.ts +15 -4
- package/dist/core/generate/validate-replacement.js +28 -13
- package/dist/core/ignore/find-ignore-rule.d.ts +8 -7
- package/dist/core/index.d.ts +18 -0
- package/dist/core/instrument/find-attribute-values.d.ts +12 -0
- package/dist/core/instrument/find-attribute-values.js +13 -0
- package/dist/core/instrument/get-site-syntax.d.ts +14 -0
- package/dist/core/instrument/get-site-syntax.js +12 -0
- package/dist/core/instrument/group-mutant-ranges.d.ts +7 -3
- package/dist/core/instrument/group-mutant-ranges.js +25 -19
- package/dist/core/instrument/instrument-file.d.ts +5 -3
- package/dist/core/instrument/instrument-file.js +10 -9
- package/dist/core/instrument/instrumenter-version.d.ts +1 -1
- package/dist/core/instrument/render-branch.d.ts +17 -0
- package/dist/core/instrument/render-branch.js +81 -0
- package/dist/core/instrument/render-mutant-range.d.ts +17 -6
- package/dist/core/instrument/render-mutant-range.js +39 -13
- package/dist/core/list-mutants.d.ts +7 -5
- package/dist/core/list-mutants.js +2 -2
- package/dist/core/mutators/array-element.d.ts +7 -6
- package/dist/core/mutators/array-element.js +13 -13
- package/dist/core/mutators/assignment-operator.js +34 -33
- package/dist/core/mutators/boolean-literal.d.ts +3 -2
- package/dist/core/mutators/number-literal.d.ts +1 -1
- package/dist/core/mutators/object-property.d.ts +4 -3
- package/dist/core/mutators/object-property.js +7 -8
- package/dist/core/mutators/return-value.js +65 -33
- package/dist/core/mutators/shared/get-branch-copy-skip.d.ts +14 -9
- package/dist/core/mutators/shared/get-branch-copy-skip.js +34 -35
- package/dist/core/mutators/shared/get-canonical-falsy-default.d.ts +32 -0
- package/dist/core/mutators/shared/get-canonical-falsy-default.js +11 -0
- package/dist/core/mutators/shared/get-comparison-plan.d.ts +2 -2
- package/dist/core/mutators/shared/get-comparison-plan.js +86 -85
- package/dist/core/mutators/shared/get-condition-constants.d.ts +8 -8
- package/dist/core/mutators/shared/get-condition-constants.js +3 -3
- package/dist/core/mutators/shared/get-default-option-skip.d.ts +2 -2
- package/dist/core/mutators/shared/get-endless-value.d.ts +20 -0
- package/dist/core/mutators/shared/get-endless-value.js +25 -0
- package/dist/core/mutators/shared/get-forced-test-justifier.d.ts +44 -0
- package/dist/core/mutators/shared/get-forced-test-justifier.js +25 -0
- package/dist/core/mutators/shared/get-group-constant.d.ts +6 -6
- package/dist/core/mutators/shared/get-group-constant.js +2 -2
- package/dist/core/mutators/shared/get-literal-skip.d.ts +9 -9
- package/dist/core/mutators/shared/get-literal-skip.js +2 -2
- package/dist/core/mutators/shared/get-logical-drops.d.ts +8 -8
- package/dist/core/mutators/shared/get-logical-drops.js +80 -82
- 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/get-owner-constant.d.ts +3 -1
- package/dist/core/mutators/shared/get-running-value.d.ts +5 -4
- package/dist/core/mutators/shared/get-toward-mutant.d.ts +10 -2
- package/dist/core/mutators/shared/get-toward-mutant.js +45 -40
- package/dist/core/mutators/shared/has-other-exit.js +16 -36
- package/dist/core/mutators/shared/is-loop-exit.d.ts +20 -0
- package/dist/core/mutators/shared/is-loop-exit.js +32 -0
- package/dist/core/mutators/shared/is-read-only.d.ts +26 -0
- package/dist/core/mutators/shared/is-read-only.js +53 -0
- 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/mutators/statement-removal.d.ts +4 -3
- package/dist/core/mutators/statement-removal.js +69 -73
- package/dist/core/mutators/string-literal.d.ts +15 -5
- package/dist/core/mutators/string-literal.js +79 -50
- 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/presets/recommended.d.ts +2 -2
- package/dist/core/presets/strict.d.ts +4 -2
- 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-batch-result.d.ts +23 -22
- package/dist/core/run/apply-batch-result.js +5 -5
- package/dist/core/run/apply-isolated-result.d.ts +21 -12
- package/dist/core/run/apply-isolated-result.js +45 -25
- package/dist/core/run/classify-try.d.ts +9 -8
- 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-test-file-limits.d.ts +13 -0
- package/dist/core/run/get-test-file-limits.js +13 -0
- package/dist/core/run/get-unit-evidence.d.ts +12 -3
- 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/plan-batch.d.ts +6 -3
- package/dist/core/run/plan-batch.js +36 -31
- package/dist/core/run/plan-isolated.d.ts +3 -1
- package/dist/core/run/plan-isolated.js +8 -14
- package/dist/core/run/read-isolated-unit.d.ts +9 -6
- 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-batch-phases.d.ts +4 -3
- package/dist/core/run/run-dry-phase.d.ts +35 -19
- package/dist/core/run/run-dry-phase.js +127 -77
- package/dist/core/run/run-isolated-rounds.d.ts +15 -10
- package/dist/core/run/run-isolated-rounds.js +4 -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 +59 -22
- package/dist/core/run-mutants.js +356 -208
- package/dist/core/runtime/create-hit-limit-error.d.ts +5 -3
- package/dist/core/runtime/create-hit-limit-error.js +1 -1
- package/dist/core/runtime/install-mutant-runtime.js +23 -6
- package/dist/core/runtime/runtime-version.d.ts +4 -4
- package/dist/core/skips/skip-rules.d.ts +7 -1
- package/dist/core/skips/skip-rules.js +4 -0
- package/dist/core/syntax/is-brace-sensitive-attribute.d.ts +18 -0
- package/dist/core/syntax/is-brace-sensitive-attribute.js +28 -0
- package/dist/core/syntax/is-spread-safe-member.d.ts +18 -0
- package/dist/core/syntax/is-spread-safe-member.js +18 -0
- package/dist/core/syntax/is-value-position.d.ts +3 -1
- package/dist/core/text/get-list-removal-range.d.ts +22 -0
- package/dist/core/text/get-list-removal-range.js +46 -0
- package/dist/core/text/is-plain-attribute-string.d.ts +10 -0
- package/dist/core/text/is-plain-attribute-string.js +5 -0
- package/dist/core/text/parse-expression.d.ts +8 -4
- package/dist/core/text/parse-expression.js +1 -0
- package/dist/core/text/remove-list-element.d.ts +2 -4
- package/dist/core/text/remove-list-element.js +4 -45
- package/dist/docs/styles/colors.js +1 -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 +6 -3
- package/dist/types/adapter/dry-run-request.d.ts +5 -4
- package/dist/types/adapter/isolated-plan.d.ts +2 -1
- package/dist/types/adapter/isolated-result.d.ts +3 -1
- package/dist/types/adapter/mutant-runtime.d.ts +30 -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/cli/text-style.d.ts +1 -1
- package/dist/types/config/plugin.d.ts +11 -2
- package/dist/types/config/preset-settings.d.ts +2 -2
- package/dist/types/config/run-config.d.ts +22 -4
- package/dist/types/config/run-settings.d.ts +6 -0
- package/dist/types/html/indexed-mutant.d.ts +4 -2
- package/dist/types/html/shown-change.d.ts +4 -3
- package/dist/types/mutant/core-note.d.ts +12 -0
- package/dist/types/mutant/diagnostic.d.ts +1 -0
- package/dist/types/mutant/list-removal.d.ts +37 -0
- package/dist/types/mutant/mutant-candidate.d.ts +11 -17
- package/dist/types/mutant/mutant-host.d.ts +49 -0
- package/dist/types/mutant/mutant-kind.d.ts +18 -0
- package/dist/types/mutant/mutant-range.d.ts +15 -8
- package/dist/types/mutant/mutant.d.ts +9 -15
- package/dist/types/mutant/registered-skip-rule.d.ts +11 -0
- package/dist/types/mutant/site-syntax.d.ts +14 -0
- package/dist/types/mutant/skip-justifier.d.ts +3 -1
- 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 +27 -17
- package/dist/types/mutant/skipped-mutant.d.ts +15 -12
- package/dist/types/mutator/mutator.d.ts +3 -2
- package/dist/types/mutator/registered-mutator.d.ts +8 -0
- package/dist/types/mutator/replacement.d.ts +14 -3
- package/dist/types/regex/regex-change.d.ts +2 -2
- package/dist/types/report/html-report.d.ts +13 -9
- package/dist/types/report/list-report-focus.d.ts +3 -2
- package/dist/types/report/list-report-justifier.d.ts +4 -2
- package/dist/types/report/list-report-mutant.d.ts +15 -9
- package/dist/types/report/list-report-skipped.d.ts +6 -4
- package/dist/types/report/list-report.d.ts +1 -1
- package/dist/types/report/run-report.d.ts +13 -4
- package/dist/types/report/slim-list-report.d.ts +6 -3
- package/dist/types/report/slim-run-report.d.ts +2 -2
- package/dist/types/run/isolated-evidence.d.ts +3 -2
- package/dist/types/run/isolated-reason.d.ts +6 -4
- package/dist/types/run/mutant-state.d.ts +1 -1
- package/dist/types/run/run-durations.d.ts +8 -3
- package/dist/types/run/run-event.d.ts +11 -8
- package/dist/types/run/run-kind.d.ts +3 -2
- package/dist/types/run/run-result.d.ts +17 -5
- package/dist/types/run/run-state.d.ts +30 -1
- package/dist/types/run/run-status.d.ts +2 -2
- package/dist/types/run/try-cause.d.ts +10 -7
- package/dist/types/syntax/syntax-helpers.d.ts +5 -3
- package/package.json +5 -5
- package/readme.md +85 -68
- package/skills/mootant/SKILL.md +50 -31
- package/skills/mootant/references/mutators.md +31 -23
- package/dist/adapters/node-test/list-flag-values.js +0 -9
- package/dist/core/instrument/get-site-check.d.ts +0 -9
- package/dist/core/instrument/get-site-check.js +0 -5
- package/dist/core/instrument/get-template-site-check.d.ts +0 -12
- package/dist/core/instrument/get-template-site-check.js +0 -5
- /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/cli/{built-in-adapters.d.ts → get-built-in-adapters.d.ts} +0 -0
- /package/dist/cli/{built-in-adapters.js → get-built-in-adapters.js} +0 -0
- /package/dist/cli/terminal/{colors.d.ts → create-colors.d.ts} +0 -0
- /package/dist/cli/terminal/{colors.js → create-colors.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
|
@@ -11,138 +11,173 @@ async function o(e, t) {
|
|
|
11
11
|
let n = /* @__PURE__ */ new Map(), r = [];
|
|
12
12
|
if (t.switched.length === 0) return {
|
|
13
13
|
unrepeatableFiles: /* @__PURE__ */ new Set(),
|
|
14
|
-
dry:
|
|
14
|
+
dry: S(),
|
|
15
15
|
diagnostics: r,
|
|
16
16
|
runs: 0,
|
|
17
17
|
errors: n
|
|
18
18
|
};
|
|
19
|
-
let i = t.switched.map((e) => e.file);
|
|
20
19
|
t.report({
|
|
21
|
-
files:
|
|
20
|
+
files: t.switched.length,
|
|
22
21
|
kind: "dry-start"
|
|
23
22
|
});
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
let i = await s(e, t, {
|
|
24
|
+
related: t.related,
|
|
25
|
+
diagnostics: r
|
|
26
|
+
}), a = [i.dry], o = b(i.dry);
|
|
27
|
+
if (o.failing.length > 0 || o.unloaded.length > 0) {
|
|
28
|
+
let s = await l(e, t, {
|
|
29
|
+
files: i.dry.files,
|
|
30
|
+
tests: i.dry.tests,
|
|
27
31
|
diagnostics: r,
|
|
28
|
-
failures:
|
|
29
|
-
related: i,
|
|
32
|
+
failures: o,
|
|
30
33
|
errors: n
|
|
31
34
|
});
|
|
32
|
-
|
|
35
|
+
a.push(s.dry), i = {
|
|
33
36
|
...s,
|
|
34
|
-
runs:
|
|
37
|
+
runs: i.runs + s.runs
|
|
35
38
|
};
|
|
36
39
|
}
|
|
37
|
-
return
|
|
38
|
-
instrumented:
|
|
40
|
+
return d(t, {
|
|
41
|
+
instrumented: a,
|
|
39
42
|
diagnostics: r,
|
|
40
43
|
errors: n
|
|
41
44
|
}), {
|
|
42
|
-
...
|
|
45
|
+
...i,
|
|
43
46
|
diagnostics: r,
|
|
44
47
|
errors: n
|
|
45
48
|
};
|
|
46
49
|
}
|
|
47
50
|
async function s(t, r, a) {
|
|
48
|
-
let o = await
|
|
49
|
-
repeat:
|
|
51
|
+
let { diagnostics: o, related: s } = a, c = await p(t, {
|
|
52
|
+
repeat: r.repeat,
|
|
50
53
|
instrumented: !0,
|
|
51
54
|
files: null,
|
|
52
|
-
related:
|
|
53
|
-
},
|
|
54
|
-
if (
|
|
55
|
+
related: s
|
|
56
|
+
}, r.root), { unloaded: l, failing: u } = b(c);
|
|
57
|
+
if (u.length === 0 && l.length === 0) return {
|
|
55
58
|
unrepeatableFiles: /* @__PURE__ */ new Set(),
|
|
56
59
|
runs: 1,
|
|
57
|
-
dry:
|
|
60
|
+
dry: c
|
|
58
61
|
};
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
message: `${i(
|
|
62
|
+
let d = v([...u, ...l]), f = d.length === 1 ? "it" : "them";
|
|
63
|
+
r.report({
|
|
64
|
+
message: r.repeat ? `${i(d.length, "test file")} failed with each test run twice; running ${f} again with each test once.` : `${i(d.length, "test file")} failed; running ${f} again to see whether the failures repeat.`,
|
|
62
65
|
kind: "dry-again"
|
|
63
66
|
});
|
|
64
|
-
let
|
|
67
|
+
let h = await p(t, {
|
|
65
68
|
instrumented: !0,
|
|
66
69
|
repeat: !1,
|
|
67
|
-
related:
|
|
68
|
-
files:
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
related: s,
|
|
71
|
+
files: d
|
|
72
|
+
}, r.root), g = new Set(d.map((e) => n(e))), { unloaded: _, failing: y } = b(h), x = new Set([...y, ..._].map((e) => n(e))), S = new Set([...g].filter((e) => !x.has(e)));
|
|
73
|
+
if (!r.repeat) {
|
|
74
|
+
let e = [...l, ...u].filter((e) => S.has(n(e))).map((e) => m(e, r.root));
|
|
75
|
+
for (let t of e) o.some((e) => e.message === t.message && e.file === t.file && e.line === t.line) || o.push(t);
|
|
76
|
+
}
|
|
77
|
+
function w(e) {
|
|
78
|
+
return g.has(n(e));
|
|
72
79
|
}
|
|
73
80
|
return {
|
|
74
81
|
dry: {
|
|
75
|
-
tests: [...
|
|
76
|
-
files: [...
|
|
77
|
-
mismatched:
|
|
78
|
-
outside:
|
|
79
|
-
served:
|
|
80
|
-
...(
|
|
82
|
+
tests: [...c.tests.filter((e) => !w(e)), ...h.tests].toSorted(e),
|
|
83
|
+
files: [...c.files.filter((e) => !w(e)), ...h.files].toSorted(e),
|
|
84
|
+
mismatched: C(c.mismatched, h.mismatched),
|
|
85
|
+
outside: C(c.outside, h.outside),
|
|
86
|
+
served: C(c.served, h.served),
|
|
87
|
+
...(c.unserved ?? h.unserved) !== void 0 && { unserved: [...c.unserved ?? [], ...h.unserved ?? []] },
|
|
81
88
|
hung: []
|
|
82
89
|
},
|
|
83
|
-
unrepeatableFiles: new Set(
|
|
90
|
+
unrepeatableFiles: r.repeat ? S : /* @__PURE__ */ new Set(),
|
|
84
91
|
runs: 2
|
|
85
92
|
};
|
|
86
93
|
}
|
|
87
|
-
|
|
94
|
+
function c(e, t) {
|
|
95
|
+
let { failures: r, files: i } = t, a = e.switched.map((e) => e.file), o = new Set(a), s = new Map(i.map((e) => [n(e), (e.dependencies ?? []).filter((e) => o.has(e))])), c = /* @__PURE__ */ new Map();
|
|
96
|
+
function l(e, t, n) {
|
|
97
|
+
for (let r of n) c.has(r) || c.set(r, {
|
|
98
|
+
failure: e,
|
|
99
|
+
link: t
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
for (let t of r.unloaded) {
|
|
103
|
+
let r = t.covers.map((t) => e.mutantFiles.get(t)), i = s.get(n(t));
|
|
104
|
+
i.length > 0 ? l(t, "dependency", [...r, ...i]) : l(t, "sites", r);
|
|
105
|
+
}
|
|
106
|
+
for (let t of r.failing) {
|
|
107
|
+
let r = (t.tries[0].covers ?? []).map((t) => e.mutantFiles.get(t));
|
|
108
|
+
r.length > 0 ? l(t, "sites", r) : l(t, "dependency", s.get(n(t)) ?? []);
|
|
109
|
+
}
|
|
110
|
+
if (c.size === 0) {
|
|
111
|
+
let [e] = [...r.unloaded, ...r.failing];
|
|
112
|
+
return new Map(a.map((t) => [t, {
|
|
113
|
+
failure: e,
|
|
114
|
+
link: "unknown"
|
|
115
|
+
}]));
|
|
116
|
+
}
|
|
117
|
+
return new Map(a.filter((e) => c.has(e)).map((e) => [e, c.get(e)]));
|
|
118
|
+
}
|
|
119
|
+
async function l(e, t, n) {
|
|
88
120
|
await u(e, t, n);
|
|
89
|
-
let r =
|
|
90
|
-
for (let e of r) {
|
|
91
|
-
let r = t.displays.get(e),
|
|
92
|
-
n.errors.set(r,
|
|
121
|
+
let r = c(t, n);
|
|
122
|
+
for (let [e, i] of r) {
|
|
123
|
+
let r = t.displays.get(e), a = h(i, r, t.root);
|
|
124
|
+
n.errors.set(r, a), n.diagnostics.push(g("instrumentation-break", r, a));
|
|
93
125
|
}
|
|
94
126
|
let a = t.switched.filter((e) => !r.has(e.file));
|
|
95
127
|
if (t.switched.splice(0, t.switched.length, ...a), a.length === 0) return {
|
|
96
128
|
unrepeatableFiles: /* @__PURE__ */ new Set(),
|
|
97
|
-
dry:
|
|
129
|
+
dry: S(),
|
|
98
130
|
runs: 1
|
|
99
131
|
};
|
|
100
132
|
t.report({
|
|
101
133
|
message: `Running the dry run again without ${i(r.size, "file")} that broke tests.`,
|
|
102
134
|
kind: "dry-again"
|
|
103
135
|
});
|
|
104
|
-
let o = await s(e,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
136
|
+
let o = await s(e, t, {
|
|
137
|
+
related: t.related.filter((e) => !r.has(e)),
|
|
138
|
+
diagnostics: n.diagnostics
|
|
139
|
+
}), l = b(o.dry);
|
|
140
|
+
if (l.failing.length > 0 || l.unloaded.length > 0) throw y(t, [...l.failing, ...l.unloaded]), Error(f("Tests still fail with mootant's switched files after the files that broke them were dropped", {
|
|
141
|
+
files: l.unloaded,
|
|
142
|
+
tests: l.failing
|
|
108
143
|
}, t.root));
|
|
109
144
|
return {
|
|
110
145
|
...o,
|
|
111
146
|
runs: o.runs + 1
|
|
112
147
|
};
|
|
113
148
|
}
|
|
114
|
-
function
|
|
115
|
-
let
|
|
116
|
-
for (let { file: a } of e.switched) {
|
|
117
|
-
let o = e.displays.get(a);
|
|
118
|
-
if (n.has(a)) {
|
|
119
|
-
let e = `The test runner loaded ${o} with a text that differs from the listed one; its mutants are not run.`;
|
|
120
|
-
t.errors.set(o, e), t.diagnostics.push(m("instrument-error", o, e));
|
|
121
|
-
} else r.has(a) || t.diagnostics.push(m("never-served", o, `No test loaded ${o} through the test runner's transform: ${i.get(a) ?? "no test imports it, or tests import a built copy, an external or a pre-bundled dependency"}.`));
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
async function u(e, t, n) {
|
|
125
|
-
let { failures: r, related: i } = n, { unloaded: a, failing: o } = r, s = new Set(o.map((e) => e.id)), c = new Set(a.map((e) => e.file));
|
|
149
|
+
async function u(e, t, r) {
|
|
150
|
+
let { failures: i, tests: a } = r, { unloaded: o, failing: s } = i, c = new Set(s.map((e) => e.id)), l = new Set(a.map((e) => e.id)), u = new Set(o.map((e) => n(e))), d = new Set([...o, ...s].map((e) => n(e)));
|
|
126
151
|
t.report({
|
|
127
152
|
message: "Some tests failed; running them again without mutants to check.",
|
|
128
153
|
kind: "dry-again"
|
|
129
154
|
});
|
|
130
|
-
let
|
|
131
|
-
files:
|
|
155
|
+
let m = b(await p(e, {
|
|
156
|
+
files: v([...s, ...o]),
|
|
157
|
+
related: t.related,
|
|
132
158
|
instrumented: !1,
|
|
133
|
-
repeat: !1
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
tests: u
|
|
159
|
+
repeat: !1
|
|
160
|
+
}, t.root)), h = m.failing.filter((e) => c.has(e.id) || !l.has(e.id) && u.has(n(e))), g = m.unloaded.filter((e) => d.has(n(e)));
|
|
161
|
+
if (h.length > 0 || g.length > 0) throw y(t, [...h, ...g]), Error(f("Tests fail without mutants; fix them first", {
|
|
162
|
+
files: g,
|
|
163
|
+
tests: h
|
|
139
164
|
}, t.root));
|
|
140
165
|
}
|
|
141
|
-
function d(e, t
|
|
166
|
+
function d(e, t) {
|
|
167
|
+
let n = new Set(t.instrumented.flatMap((e) => e.mismatched)), r = new Set(t.instrumented.flatMap((e) => e.served)), i = new Map(t.instrumented.flatMap((e) => e.unserved ?? []).map((e) => [e.file, e.reason]));
|
|
168
|
+
for (let { file: a } of e.switched) {
|
|
169
|
+
let o = e.displays.get(a);
|
|
170
|
+
if (n.has(a)) {
|
|
171
|
+
let e = `The test runner loaded ${o} with a text that differs from the listed one; its mutants are not run.`;
|
|
172
|
+
t.errors.set(o, e), t.diagnostics.push(g("instrument-error", o, e));
|
|
173
|
+
} else r.has(a) || t.diagnostics.push(g("never-served", o, `No test loaded ${o} through the test runner's transform: ${i.get(a) ?? "no test imports it, or tests import a built copy, an external or a pre-bundled dependency"}.`));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
function f(e, t, n) {
|
|
142
177
|
let { files: a, tests: o } = t, s = [...a.map((e) => ` ${r(e.file, n)}: fails to load: ${e.errors[0] ?? "unknown error"}`), ...o.map((e) => ` ${r(e.file, n)} > ${e.name}: ${e.tries[0].message ?? "failed"}`)], c = `${e} (${[o.length > 0 && i(o.length, "test"), a.length > 0 && i(a.length, "test file")].filter(Boolean).join(", ")}):\n${s.slice(0, 10).join("\n")}`;
|
|
143
178
|
return s.length > 10 && (c += `\n and ${s.length - 10} more`), s.some((e) => /snapshot/iu.test(e)) && (c += "\nSnapshots may be missing or obsolete: mootant never writes or removes them, so update them with the test runner first."), c;
|
|
144
179
|
}
|
|
145
|
-
async function
|
|
180
|
+
async function p(e, t, n) {
|
|
146
181
|
let i = await e.dryRun({
|
|
147
182
|
...t,
|
|
148
183
|
timeouts: a
|
|
@@ -153,13 +188,20 @@ async function f(e, t, n) {
|
|
|
153
188
|
}
|
|
154
189
|
return i;
|
|
155
190
|
}
|
|
156
|
-
function
|
|
157
|
-
let
|
|
158
|
-
return
|
|
191
|
+
function m(e, t) {
|
|
192
|
+
let n = r(e.file, t);
|
|
193
|
+
return "tries" in e ? {
|
|
194
|
+
...g("unrepeatable-test", n, `"${e.name}" failed${x(e.tries[0].message)} in a run without mutants and passed when run again; it may be flaky and kill mutants by chance.`),
|
|
195
|
+
line: e.line
|
|
196
|
+
} : g("unrepeatable-test", n, `${n} failed outside its tests${x(e.errors[0])} in a run without mutants and passed when run again; its tests may be flaky and kill mutants by chance.`);
|
|
197
|
+
}
|
|
198
|
+
function h(e, t, n) {
|
|
199
|
+
let r = _(e.failure, n);
|
|
200
|
+
return e.link === "sites" ? `Tests that reach mutant sites of ${t} fail only with mootant's switched files, such as ${r}; its mutants are not run.` : e.link === "dependency" ? `Tests that depend on ${t} fail only with mootant's switched files, such as ${r}; its mutants are not run.` : `Tests fail only with mootant's switched files, such as ${r}, and mootant cannot tell which switched file breaks them; the mutants of every switched file are not run.`;
|
|
159
201
|
}
|
|
160
|
-
function
|
|
202
|
+
function g(e, t, n) {
|
|
161
203
|
return {
|
|
162
|
-
severity: e === "never-served" ? "warning" : "error",
|
|
204
|
+
severity: e === "never-served" || e === "unrepeatable-test" ? "warning" : "error",
|
|
163
205
|
column: null,
|
|
164
206
|
line: null,
|
|
165
207
|
message: n,
|
|
@@ -167,7 +209,11 @@ function m(e, t, n) {
|
|
|
167
209
|
code: e
|
|
168
210
|
};
|
|
169
211
|
}
|
|
170
|
-
function
|
|
212
|
+
function _(e, t) {
|
|
213
|
+
let n = r(e.file, t);
|
|
214
|
+
return "tries" in e ? `"${e.name}" in ${n}${x(e.tries[0].message)}` : `${n}, which fails outside its tests${x(e.errors[0])}`;
|
|
215
|
+
}
|
|
216
|
+
function v(e) {
|
|
171
217
|
return [...new Map(e.map(({ project: e, file: t }) => [n({
|
|
172
218
|
project: e,
|
|
173
219
|
file: t
|
|
@@ -176,19 +222,23 @@ function h(e) {
|
|
|
176
222
|
file: t
|
|
177
223
|
}])).values()];
|
|
178
224
|
}
|
|
179
|
-
function
|
|
225
|
+
function y(e, n) {
|
|
180
226
|
e.report({
|
|
181
227
|
files: [...new Set(n.map(({ file: t }) => r(t, e.root)))].toSorted(t),
|
|
182
228
|
kind: "dry-failed"
|
|
183
229
|
});
|
|
184
230
|
}
|
|
185
|
-
function
|
|
231
|
+
function b(e) {
|
|
186
232
|
return {
|
|
187
233
|
failing: e.tests.filter((e) => e.tries[0].failed),
|
|
188
234
|
unloaded: e.files.filter((e) => e.loadFailed)
|
|
189
235
|
};
|
|
190
236
|
}
|
|
191
|
-
function
|
|
237
|
+
function x(e) {
|
|
238
|
+
let t = e?.replace(/\.$/u, "") ?? "";
|
|
239
|
+
return t === "" ? "" : ` (${t})`;
|
|
240
|
+
}
|
|
241
|
+
function S() {
|
|
192
242
|
return {
|
|
193
243
|
mismatched: [],
|
|
194
244
|
outside: [],
|
|
@@ -198,7 +248,7 @@ function v() {
|
|
|
198
248
|
hung: []
|
|
199
249
|
};
|
|
200
250
|
}
|
|
201
|
-
function
|
|
251
|
+
function C(e, n) {
|
|
202
252
|
return [.../* @__PURE__ */ new Set([...e, ...n])].toSorted(t);
|
|
203
253
|
}
|
|
204
254
|
export { o as runDryPhase };
|
|
@@ -8,17 +8,22 @@ import { AdapterSession } from '../../types/adapter/adapter-session.js';
|
|
|
8
8
|
* and the second round, then twice as many as in the round before (2, 4, 8, and
|
|
9
9
|
* so on), so a mutant stops at the batch of the file that killed it, and a
|
|
10
10
|
* survivor, which must run every file, needs only a few rounds. Idle workers
|
|
11
|
-
* take no extra files: a unit can wait for another of
|
|
12
|
-
* pool runs units in order, so extra files may make a
|
|
13
|
-
* measurements showed no gain. A mutant whose timeout waits
|
|
14
|
-
* confirmation
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
11
|
+
* take no extra files: without parallel units a unit can wait for another of
|
|
12
|
+
* its test file, and the pool runs units in order, so extra files may make a
|
|
13
|
+
* round longer, and measurements showed no gain. A mutant whose timeout waits
|
|
14
|
+
* for its confirmation, or whose crash waits for one more run of its unit,
|
|
15
|
+
* takes no new files until that run decides it. The verdict comes from the
|
|
16
|
+
* first file with evidence (`decideEvidence`), so it does not depend on the
|
|
17
|
+
* batches or the workers. A round also runs the retries and confirmations of
|
|
18
|
+
* the round before. A request lives at most eight rounds, as a unit missing
|
|
19
|
+
* twice gets an `Error` verdict, and so does a second inconclusive unit of the
|
|
20
|
+
* mutant in the test file, a second crash of it kills, and a timeout is
|
|
21
|
+
* confirmed once, or twice when the confirmation of a timer goes over the hit
|
|
22
|
+
* limit, so the rounds end. While a round runs, its units count in the live
|
|
20
23
|
* verdict counts as they end (`previewIsolatedUnit`), and every mutant is
|
|
21
|
-
* counted again once its result is recorded (`countVerdicts`).
|
|
24
|
+
* counted again once its result is recorded (`countVerdicts`). With parallel
|
|
25
|
+
* units (`RunState.parallelUnits`) the units of one test file form no serial
|
|
26
|
+
* chain in the estimate of a round.
|
|
22
27
|
*
|
|
23
28
|
* @param session - Live test runner.
|
|
24
29
|
* @param state - State of the run, updated in place.
|
|
@@ -15,7 +15,9 @@ async function s(o, s, c) {
|
|
|
15
15
|
for (let [e, t] of m) for (let n of t) d.push({
|
|
16
16
|
mutant: e.mutant.id,
|
|
17
17
|
confirming: !1,
|
|
18
|
+
crashed: !1,
|
|
18
19
|
retried: !1,
|
|
20
|
+
raised: !1,
|
|
19
21
|
file: n
|
|
20
22
|
});
|
|
21
23
|
if (d.length === 0) return null;
|
|
@@ -24,12 +26,12 @@ async function s(o, s, c) {
|
|
|
24
26
|
survivors: /* @__PURE__ */ new Set(),
|
|
25
27
|
retrying: /* @__PURE__ */ new Set()
|
|
26
28
|
};
|
|
27
|
-
for (let e of d) e.confirming ? _.confirming.add(e.mutant) : e.retried ? _.retrying.add(e.mutant) : u > 0 && _.survivors.add(e.mutant);
|
|
29
|
+
for (let e of d) e.confirming ? _.confirming.add(e.mutant) : e.retried || e.crashed || e.inconclusive === !0 ? _.retrying.add(e.mutant) : u > 0 && _.survivors.add(e.mutant);
|
|
28
30
|
for (let e of _.confirming) _.retrying.delete(e);
|
|
29
31
|
for (let e of [..._.confirming, ..._.retrying]) _.survivors.delete(e);
|
|
30
32
|
a(s, "isolated", {
|
|
31
33
|
costs: d.map((e, t) => e.confirming ? h.units[t].limits.timeout : i(s, e.file)),
|
|
32
|
-
chains: n(d.map((e) => e.file)),
|
|
34
|
+
chains: s.parallelUnits === !0 ? d.map((e, t) => t) : n(d.map((e) => e.file)),
|
|
33
35
|
confirming: _.confirming.size,
|
|
34
36
|
survivors: _.survivors.size,
|
|
35
37
|
retrying: _.retrying.size,
|
|
@@ -2,7 +2,7 @@ import { TestAdapter } from '../../types/adapter/test-adapter.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Checks the shape of a test runner adapter given in the configuration: an
|
|
4
4
|
* object with a kebab-case `name`, a boolean `batch`, a `start` function and,
|
|
5
|
-
* when present, a string `version`.
|
|
5
|
+
* when present, a string `version` and a boolean `parallelUnits`.
|
|
6
6
|
*
|
|
7
7
|
* @param value - Adapter object of the configuration.
|
|
8
8
|
* @param source - Where it came from, for messages, such as `run.runner`.
|
|
@@ -6,6 +6,6 @@ function n(e, t) {
|
|
|
6
6
|
return e;
|
|
7
7
|
}
|
|
8
8
|
function r(n) {
|
|
9
|
-
return t(n) ? typeof n.name != "string" || !e(n.name) ? "\"name\" must be a kebab-case name" : typeof n.batch == "boolean" ? typeof n.start == "function" ? n.version !== void 0 && typeof n.version != "string" ? "\"version\" must be a string" : null : "\"start\" must be a function" : "\"batch\" must be true or false" : "it must be an object";
|
|
9
|
+
return t(n) ? typeof n.name != "string" || !e(n.name) ? "\"name\" must be a kebab-case name" : typeof n.batch == "boolean" ? typeof n.start == "function" ? n.version !== void 0 && typeof n.version != "string" ? "\"version\" must be a string" : n.parallelUnits !== void 0 && typeof n.parallelUnits != "boolean" ? "\"parallelUnits\" must be true or false" : null : "\"start\" must be a function" : "\"batch\" must be true or false" : "it must be an object";
|
|
10
10
|
}
|
|
11
11
|
export { n as validateAdapter };
|
|
@@ -16,6 +16,12 @@ interface RunMutantsOptions {
|
|
|
16
16
|
* never names a test runner.
|
|
17
17
|
*/
|
|
18
18
|
builtIns: BuiltInAdapters;
|
|
19
|
+
/**
|
|
20
|
+
* Parallel units (`--parallel-units`): isolated units of one test file may
|
|
21
|
+
* run at the same time; over `run.parallelUnits`. With an adapter that cannot
|
|
22
|
+
* run them so, the run notes it and runs them one after another.
|
|
23
|
+
*/
|
|
24
|
+
parallelUnits?: boolean;
|
|
19
25
|
/**
|
|
20
26
|
* Incremental mode (`--incremental`): a cached verdict is reused while the
|
|
21
27
|
* region of its mutant (see `getMutantRegions`) and what its test file reads
|
|
@@ -27,6 +33,15 @@ interface RunMutantsOptions {
|
|
|
27
33
|
* Ids of the only mutants to run (`--mutant`); every mutant when omitted.
|
|
28
34
|
*/
|
|
29
35
|
mutantIds?: string[];
|
|
36
|
+
/**
|
|
37
|
+
* Interrupts the run once aborted, such as on a signal to the command line:
|
|
38
|
+
* no further run of the test runner starts, the adapter stops the running one
|
|
39
|
+
* (`AdapterContext.signal`), what that run gave is dropped, the session
|
|
40
|
+
* closes, the work directory is removed and the run rejects with the signal's
|
|
41
|
+
* reason. A signal that comes after the last run of the test runner ended
|
|
42
|
+
* lets the run end as without it, saving its cache.
|
|
43
|
+
*/
|
|
44
|
+
signal?: AbortSignal;
|
|
30
45
|
/**
|
|
31
46
|
* Most test files at once; over `run.concurrency`.
|
|
32
47
|
*/
|
|
@@ -56,7 +71,8 @@ interface RunMutantsOptions {
|
|
|
56
71
|
cache?: boolean;
|
|
57
72
|
/**
|
|
58
73
|
* Git revision given with `--since`: only mutants on lines changed since its
|
|
59
|
-
* merge base with `HEAD` run
|
|
74
|
+
* merge base with `HEAD` run, and the mutants that skipped candidates on
|
|
75
|
+
* those lines are left to.
|
|
60
76
|
*/
|
|
61
77
|
since?: string;
|
|
62
78
|
/**
|
|
@@ -77,32 +93,53 @@ interface RunMutantsOptions {
|
|
|
77
93
|
}
|
|
78
94
|
/**
|
|
79
95
|
* Runs the mutants of the given paths against the project's tests: lists the
|
|
80
|
-
* mutants, starts the test runner through its adapter,
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
96
|
+
* mutants, starts the test runner through its adapter, hosts the mutants of
|
|
97
|
+
* every file of the paths, checking that switched Svelte and Vue components
|
|
98
|
+
* compile, switches the files of the selected mutants, runs the related tests
|
|
99
|
+
* without a mutant, then decides every covered mutant on the isolated path,
|
|
100
|
+
* where each mutant gets a fresh module graph and its whole covering test
|
|
101
|
+
* files. In fast mode, runtime mutants first take the batch path, where one
|
|
102
|
+
* test run tries many mutants and kills are accepted as heuristic verdicts; its
|
|
103
|
+
* survivors and doubtful tries still run isolated. An adapter without batch
|
|
104
|
+
* mode runs fast mode as the default mode, with a note. Mutants the test runner
|
|
105
|
+
* ran outside its workers end with `Error` unless a test killed them. Unless
|
|
106
|
+
* the cache is off, valid verdicts of earlier runs are reused before anything
|
|
107
|
+
* runs, in incremental mode also those whose mutant kept its region, with a
|
|
108
|
+
* warning that counts the mutants whose cached evidence only their region
|
|
109
|
+
* matched, and the evidence of the run is saved after it, unless it has error
|
|
110
|
+
* diagnostics. With `--since`, only the mutants on lines changed since the
|
|
111
|
+
* merge base of the revision and `HEAD` run, with the mutants that skipped
|
|
112
|
+
* candidates on those lines are left to (see `selectChangedMutants`), and when
|
|
113
|
+
* there are none the test runner does not start. With `--since` or `--mutant`,
|
|
114
|
+
* the dry run still relates tests to the same files as a run of every mutant,
|
|
115
|
+
* not only to the files of the mutants that run. A run that writes an HTML
|
|
116
|
+
* report also lists the candidates its mutators skipped. The adapter is closed
|
|
117
|
+
* and the work directory removed whatever happens; what the adapter tells of
|
|
118
|
+
* its close, such as a global teardown that failed, joins the diagnostics of a
|
|
119
|
+
* run that went through, after its cache was saved. Unless the cache is off, in
|
|
120
|
+
* fast mode, or with `--since` or `--mutant`, a run first tries to decide its
|
|
121
|
+
* mutants from the dry run an earlier run saved and cached verdicts, without
|
|
122
|
+
* starting the test runner (`replayDrySnapshot`); a run that starts it hashes
|
|
123
|
+
* everything under the project root first, and once its session closed with
|
|
124
|
+
* nothing to tell, saves its own dry run, leaving out its work directory, which
|
|
125
|
+
* may lie in the project, or removes the saved one when it cannot be replayed
|
|
126
|
+
* (`saveDrySnapshot`), with a note that names a path that changed during the
|
|
127
|
+
* run; the time it takes counts in the isolated phase. With parallel units, an
|
|
128
|
+
* adapter that runs them may run the isolated units of one test file at the
|
|
129
|
+
* same time, and their verdicts are cached apart from those of other runs; an
|
|
130
|
+
* adapter that cannot runs them one after another, with a note. Once the signal
|
|
131
|
+
* of the options aborts, nothing more starts: a signal while the mutants are
|
|
132
|
+
* listed or a saved dry run is checked starts no test runner, and the session
|
|
133
|
+
* asks nothing more of a started one (`guardSession`), whose adapter stops what
|
|
134
|
+
* runs; the session still closes and the work directory is still removed.
|
|
100
135
|
*
|
|
101
136
|
* @param options - Paths, configuration, adapters and run settings.
|
|
102
137
|
* @returns Verdicts, diagnostics and timings, before they are formatted.
|
|
103
138
|
* @throws Error - When the configuration, the paths, a `--mutant` id or the
|
|
104
139
|
* adapter is invalid, when the changed lines cannot be read from git, when
|
|
105
|
-
* the test runner cannot start, or when tests fail without mutants
|
|
140
|
+
* the test runner cannot start, or when tests fail without mutants; the
|
|
141
|
+
* reason of the signal of the options once it aborted before the last run of
|
|
142
|
+
* the test runner ended.
|
|
106
143
|
*/
|
|
107
144
|
export declare function runMutants(options: RunMutantsOptions): Promise<RunResult>;
|
|
108
145
|
export {};
|