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
|
@@ -82,9 +82,10 @@ function a(a, c) {
|
|
|
82
82
|
preset: a.preset,
|
|
83
83
|
since: a.since,
|
|
84
84
|
mode: a.mode,
|
|
85
|
+
...a.parallelUnits && { parallelUnits: !0 },
|
|
85
86
|
files: l.files,
|
|
86
87
|
...l.skipped && { skipped: l.skipped },
|
|
87
|
-
schemaVersion:
|
|
88
|
+
schemaVersion: 4,
|
|
88
89
|
command: "run",
|
|
89
90
|
mutants: f
|
|
90
91
|
};
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
* Options of a command that change what it does, as a report shows them.
|
|
3
3
|
*/
|
|
4
4
|
interface CommandOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Whether units of one test file run at once, from `--parallel-units` or
|
|
7
|
+
* `--no-parallel-units`.
|
|
8
|
+
*/
|
|
9
|
+
parallelUnits?: boolean;
|
|
5
10
|
/**
|
|
6
11
|
* Whether verdicts are reused by region, from `--incremental` or
|
|
7
12
|
* `--no-incremental`.
|
|
@@ -5,7 +5,7 @@ function t(e, t) {
|
|
|
5
5
|
e,
|
|
6
6
|
...t.paths.map(n)
|
|
7
7
|
];
|
|
8
|
-
if (t.config !== void 0 && r.push("--config", n(t.config)), t.preset !== void 0 && r.push("--preset", n(t.preset)), t.since !== void 0 && r.push("--since", n(t.since)), t.skipped === !0 && r.push("--skipped"), t.fast !== void 0 && r.push(t.fast ? "--fast" : "--no-fast"), t.incremental !== void 0 && r.push(t.incremental ? "--incremental" : "--no-incremental"), t.threshold !== void 0 && r.push("--threshold", String(t.threshold)), t.concurrency !== void 0 && r.push("--concurrency", String(t.concurrency)), t.mutantIds !== void 0) for (let e of t.mutantIds) r.push("--mutant", n(e));
|
|
8
|
+
if (t.config !== void 0 && r.push("--config", n(t.config)), t.preset !== void 0 && r.push("--preset", n(t.preset)), t.since !== void 0 && r.push("--since", n(t.since)), t.skipped === !0 && r.push("--skipped"), t.fast !== void 0 && r.push(t.fast ? "--fast" : "--no-fast"), t.parallelUnits !== void 0 && r.push(t.parallelUnits ? "--parallel-units" : "--no-parallel-units"), t.incremental !== void 0 && r.push(t.incremental ? "--incremental" : "--no-incremental"), t.threshold !== void 0 && r.push("--threshold", String(t.threshold)), t.concurrency !== void 0 && r.push("--concurrency", String(t.concurrency)), t.mutantIds !== void 0) for (let e of t.mutantIds) r.push("--mutant", n(e));
|
|
9
9
|
return r.join(" ");
|
|
10
10
|
}
|
|
11
11
|
function n(t) {
|
|
@@ -38,10 +38,11 @@ export interface RunTextOptions {
|
|
|
38
38
|
/**
|
|
39
39
|
* Formats a run report as text: a header with the command and the test runner;
|
|
40
40
|
* the dry run, the mutants with how many were ignored or reused from the cache,
|
|
41
|
-
* and time
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
41
|
+
* and time, which names fast mode and parallel units when they were on; the
|
|
42
|
+
* counts by status and the score; in a terminal, the files with the lowest
|
|
43
|
+
* scores below 100, five at most; a section for each status to act on
|
|
44
|
+
* (`survived`, `no coverage`, `errors`) with its count and its mutants grouped
|
|
45
|
+
* by file, each as a diff of its source lines under a heading with the
|
|
45
46
|
* location, mutator and short id, the reason of an error or the likeliest test
|
|
46
47
|
* file to extend of another mutant under the diff; and a hint to re-check the
|
|
47
48
|
* first survivor, else the first listed mutant. Killed, timed-out and ignored
|
|
@@ -55,25 +55,25 @@ function p(e, t) {
|
|
|
55
55
|
}, _, i)}\n\n${_}`;
|
|
56
56
|
}
|
|
57
57
|
function m(e, t) {
|
|
58
|
-
let { summary: n } = e, { duration: r } = n, a = n.totalIgnored > 0 ? `, ${n.totalIgnored} ignored` : "", o = n.totalCached !== null && n.totalCached > 0 ? `, ${n.totalCached} cached` : "", c = [
|
|
58
|
+
let { summary: n } = e, { duration: r } = n, a = n.totalIgnored > 0 ? `, ${n.totalIgnored} ignored` : "", o = n.totalCached !== null && n.totalCached > 0 ? `, ${n.totalCached} cached` : "", c = n.runs.dry === void 0 && n.totalTests > 0, l = [
|
|
59
59
|
`start ${s(r.startup)}`,
|
|
60
60
|
`dry run ${s(r.dryRun)}`,
|
|
61
61
|
...r.batch === null ? [] : [`batch ${s(r.batch)}`],
|
|
62
62
|
`isolated ${s(r.isolated)}`
|
|
63
|
-
],
|
|
64
|
-
["dry run", `${i(n.totalTests, "test")} in ${s(r.dryRun)}`],
|
|
63
|
+
], u = [
|
|
64
|
+
["dry run", c ? `${i(n.totalTests, "test")} of an earlier run` : `${i(n.totalTests, "test")} in ${s(r.dryRun)}`],
|
|
65
65
|
["mutants", `${n.totalMutants} in ${i(n.totalFiles, "file")}${a}${o}`],
|
|
66
|
-
["time", `${s(r.total)}${e.mode === "fast" ? " in fast mode" : ""} (${
|
|
67
|
-
], { staticCost:
|
|
68
|
-
if (
|
|
69
|
-
let e = Math.max(1,
|
|
70
|
-
|
|
66
|
+
["time", `${s(r.total)}${e.mode === "fast" ? " in fast mode" : ""}${e.parallelUnits ? " with parallel units" : ""} (${l.join(", ")})`]
|
|
67
|
+
], { staticCost: d } = n;
|
|
68
|
+
if (d.length > 0 && r.total >= 3e4 && r.isolated > r.total * .25) {
|
|
69
|
+
let e = Math.max(1, d.reduce((e, t) => e + t.duration, 0));
|
|
70
|
+
u.push(["most test time", d.slice(0, 3).map((t) => `${t.file} ${Math.round(t.duration / e * 100)}%`).join(", ")]);
|
|
71
71
|
}
|
|
72
72
|
if (t) {
|
|
73
73
|
let e = f.filter((e) => n.runs[e] !== void 0).map((e) => `${n.runs[e]} ${e}`);
|
|
74
|
-
|
|
74
|
+
u.push(["runs", e.length === 0 ? "none" : e.join(", ")]);
|
|
75
75
|
}
|
|
76
|
-
return
|
|
76
|
+
return u;
|
|
77
77
|
}
|
|
78
78
|
function h(n, o) {
|
|
79
79
|
let { colors: s } = o, { ellipsis: c } = a(o.unicode), l = n.slice(0, 5), u = Math.min(e(l.map((e) => e.file)), Math.max(16, o.width - 38)), d = l.map((e) => {
|
|
@@ -3,16 +3,16 @@ import { RunReport } from '../../types/report/run-report.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Shapes a run report as `--json` prints it: the counts and scores with the
|
|
5
5
|
* total duration, the schema version, diagnostics, command, which mutants are
|
|
6
|
-
* listed, runner, preset, mode,
|
|
7
|
-
* that output cut short keeps the rest, the
|
|
8
|
-
* ignored one keeps its position, mutator,
|
|
9
|
-
* focus (`slimListMutant`), the ignore
|
|
10
|
-
* and cause of the verdict, `path` only
|
|
11
|
-
* covering tests, its likeliest test files,
|
|
12
|
-
* re-check command, each only when set. A
|
|
13
|
-
* with `--all`, keeps only its position,
|
|
14
|
-
* killed it and a batch `path`. Fields that
|
|
15
|
-
* report is what `--json --verbose` prints.
|
|
6
|
+
* listed, runner, preset, mode, parallel units when they were on, the `--since`
|
|
7
|
+
* revision when given and, last, so that output cut short keeps the rest, the
|
|
8
|
+
* mutants. A mutant to act on or an ignored one keeps its position, mutator,
|
|
9
|
+
* status, scope, source lines and focus (`slimListMutant`), the ignore
|
|
10
|
+
* directive and its reason, the message and cause of the verdict, `path` only
|
|
11
|
+
* for a batch verdict, the number of covering tests, its likeliest test files,
|
|
12
|
+
* the first covering test and the re-check command, each only when set. A
|
|
13
|
+
* killed or timed-out mutant, listed with `--all`, keeps only its position,
|
|
14
|
+
* mutator, status, the test file that killed it and a batch `path`. Fields that
|
|
15
|
+
* are null are left out; the full report is what `--json --verbose` prints.
|
|
16
16
|
*
|
|
17
17
|
* @param report - Full report of a run.
|
|
18
18
|
* @returns Report as `--json` prints it.
|
|
@@ -11,7 +11,11 @@ import { RunOptions } from './parse-arguments.js';
|
|
|
11
11
|
* --verbose` the full one. A terminal also gets the files with the lowest
|
|
12
12
|
* scores. When the run asks for an HTML report, it is written after the report
|
|
13
13
|
* is printed and its path goes to stderr; a report that cannot be written is an
|
|
14
|
-
* error.
|
|
14
|
+
* error. SIGHUP, SIGINT or SIGTERM during the run (`watchInterrupts`) ends the
|
|
15
|
+
* progress at once, without the line of the running phase, and interrupts the
|
|
16
|
+
* run, which stops its test processes and removes its files; then nothing is
|
|
17
|
+
* printed and the process ends by that signal, after 5 seconds even when the
|
|
18
|
+
* cleanup did not end.
|
|
15
19
|
*
|
|
16
20
|
* @param options - Options of the run command.
|
|
17
21
|
*/
|
package/dist/cli/run-mutation.js
CHANGED
|
@@ -1,72 +1,80 @@
|
|
|
1
1
|
import { getShortIdLength as e } from "./report/get-short-id-length.js";
|
|
2
2
|
import { printDiagnostics as t } from "./report/print-diagnostics.js";
|
|
3
3
|
import { formatRunReport as n } from "./report/format-run-report.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
4
|
+
import { getBuiltInAdapters as r } from "./get-built-in-adapters.js";
|
|
5
|
+
import { buildHtmlReport as i } from "./html/build-html-report.js";
|
|
6
|
+
import { writeHtmlReport as a } from "./html/write-html-report.js";
|
|
7
|
+
import { readProjectName as o } from "./html/read-project-name.js";
|
|
8
|
+
import { buildRunReport as s } from "./report/build-run-report.js";
|
|
9
|
+
import { createRunProgress as c } from "./create-run-progress.js";
|
|
10
|
+
import { getFileScores as l } from "./report/get-file-scores.js";
|
|
11
11
|
import { getTextStyle as u } from "./terminal/get-text-style.js";
|
|
12
12
|
import { formatCommand as d } from "./report/format-command.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import m from "
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
import { watchInterrupts as f } from "./watch-interrupts.js";
|
|
14
|
+
import { runMutants as p } from "../core/run-mutants.js";
|
|
15
|
+
import { version as m } from "../package.js";
|
|
16
|
+
import h from "node:path";
|
|
17
|
+
async function g(i) {
|
|
18
|
+
let { verbose: a, json: o, all: m, ...h } = i, g = u(process.stderr), v = f(), y = c(g, a);
|
|
19
|
+
v.signal.addEventListener("abort", () => {
|
|
20
|
+
y.stop();
|
|
21
|
+
});
|
|
18
22
|
try {
|
|
19
|
-
let
|
|
23
|
+
let c = await p({
|
|
20
24
|
onProgress: (e) => {
|
|
21
|
-
|
|
25
|
+
y.handle(e);
|
|
22
26
|
},
|
|
23
|
-
builtIns:
|
|
24
|
-
|
|
27
|
+
builtIns: r(),
|
|
28
|
+
signal: v.signal,
|
|
29
|
+
...h,
|
|
25
30
|
cwd: process.cwd()
|
|
26
31
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
if (v.end()) return;
|
|
33
|
+
y.finish();
|
|
34
|
+
let f = d("run", {
|
|
35
|
+
parallelUnits: i.parallelUnits,
|
|
36
|
+
incremental: i.incremental,
|
|
37
|
+
config: i.config,
|
|
38
|
+
preset: i.preset,
|
|
39
|
+
paths: i.paths,
|
|
40
|
+
fast: i.fast
|
|
41
|
+
}), b = s(c, {
|
|
42
|
+
recheck: f,
|
|
43
|
+
all: m
|
|
37
44
|
});
|
|
38
|
-
|
|
39
|
-
...!
|
|
40
|
-
idLength: e(
|
|
41
|
-
command: d("run",
|
|
45
|
+
o || t(b.diagnostics, g), console.info(n(b, o ? "json" : "text", {
|
|
46
|
+
...!o && process.stdout.isTTY && { files: l(c) },
|
|
47
|
+
idLength: e(c.listedIds),
|
|
48
|
+
command: d("run", i),
|
|
42
49
|
style: u(process.stdout),
|
|
43
|
-
verbose:
|
|
44
|
-
recheck:
|
|
45
|
-
})),
|
|
46
|
-
command: `${d("run",
|
|
47
|
-
style:
|
|
48
|
-
recheck:
|
|
50
|
+
verbose: a,
|
|
51
|
+
recheck: f
|
|
52
|
+
})), b.summary.passed || (process.exitCode = 1), c.html !== null && await _(c, c.html, {
|
|
53
|
+
command: `${d("run", i)}${i.html ? " --html" : ""}`,
|
|
54
|
+
style: g,
|
|
55
|
+
recheck: f
|
|
49
56
|
});
|
|
50
57
|
} catch (e) {
|
|
51
|
-
|
|
52
|
-
|
|
58
|
+
if (v.end()) return;
|
|
59
|
+
y.finish();
|
|
60
|
+
let t = y.output(), { colors: n } = g;
|
|
53
61
|
t.trim() !== "" && console.error(`${n.gray("Output of the tests:")}\n${t.replace(/\n$/u, "")}\n`), console.error(`${n.red("Error:")} ${e.message}`), process.exitCode = 1;
|
|
54
62
|
}
|
|
55
63
|
}
|
|
56
|
-
async function
|
|
57
|
-
let { colors: s } =
|
|
64
|
+
async function _(t, n, r) {
|
|
65
|
+
let { colors: s } = r.style, c = /* @__PURE__ */ new Date();
|
|
58
66
|
try {
|
|
59
|
-
let l =
|
|
67
|
+
let l = i(t, {
|
|
60
68
|
idLength: e(t.listedIds),
|
|
61
|
-
project:
|
|
62
|
-
recheck:
|
|
63
|
-
command:
|
|
69
|
+
project: o(t.root),
|
|
70
|
+
recheck: r.recheck,
|
|
71
|
+
command: r.command,
|
|
64
72
|
date: c.toISOString(),
|
|
65
|
-
version:
|
|
73
|
+
version: m
|
|
66
74
|
}), { formatHtmlReport: u } = await import("./html/format-html-report.js");
|
|
67
|
-
await
|
|
75
|
+
await a(n, u(l)), console.error(`${s.gray("html report:")} ${h.relative(process.cwd(), n)}`);
|
|
68
76
|
} catch (e) {
|
|
69
77
|
console.error(`${s.red("Error:")} The HTML report could not be written to ${n}: ${e.message}`), process.exitCode = 1;
|
|
70
78
|
}
|
|
71
79
|
}
|
|
72
|
-
export {
|
|
80
|
+
export { g as runMutation };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColorName, Color } from './colors.js';
|
|
1
|
+
import { ColorName, Color } from './create-colors.js';
|
|
2
2
|
/**
|
|
3
3
|
* Progress line that the CLI shows on standard error while a command works.
|
|
4
4
|
*/
|
|
@@ -27,8 +27,7 @@ export interface Spinner {
|
|
|
27
27
|
* In an interactive terminal the spinner redraws its row every 80 ms with the
|
|
28
28
|
* cursor hidden, asking for its text on every frame, so the text may show a
|
|
29
29
|
* live clock. Elsewhere it never animates: only the lines given to `print` are
|
|
30
|
-
* written.
|
|
31
|
-
* before the process exits.
|
|
30
|
+
* written.
|
|
32
31
|
*
|
|
33
32
|
* @param text - Gives the text next to the animation; called on every frame.
|
|
34
33
|
* @param colors - Color functions of the CLI.
|
|
@@ -17,46 +17,37 @@ const r = [
|
|
|
17
17
|
"\\",
|
|
18
18
|
"|",
|
|
19
19
|
"/"
|
|
20
|
-
], a = "\x1B[2K\x1B[1G"
|
|
21
|
-
function
|
|
22
|
-
let
|
|
23
|
-
function
|
|
20
|
+
], a = "\x1B[2K\x1B[1G";
|
|
21
|
+
function o(o, s) {
|
|
22
|
+
let c = process.stderr, l = e(), u = t() ? r : i, d = 0, f = 0, p = !1, m;
|
|
23
|
+
function h() {
|
|
24
24
|
let e = "\x1B[1G";
|
|
25
|
-
for (let t = 0; t <
|
|
26
|
-
return
|
|
25
|
+
for (let t = 0; t < f; t++) e += t === 0 ? a : `[1A${a}`;
|
|
26
|
+
return f = 0, e;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
return `${
|
|
28
|
+
function g() {
|
|
29
|
+
return `${s.greenBright(u[d])} ${o()}`;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
let e =
|
|
33
|
-
|
|
31
|
+
function _() {
|
|
32
|
+
let e = g();
|
|
33
|
+
m = setTimeout(_, 80), c.write(`[?25l${h()}${e}`), f = n(e, c.columns), d = (d + 1) % u.length;
|
|
34
34
|
}
|
|
35
|
-
let
|
|
36
|
-
|
|
37
|
-
if (!
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
process.on(e, n = () => {
|
|
41
|
-
b.stop(), process.exit(t);
|
|
42
|
-
}), g.push([e, n]);
|
|
35
|
+
let v = {
|
|
36
|
+
print(e) {
|
|
37
|
+
if (!p) {
|
|
38
|
+
c.write(`${e}\n`);
|
|
39
|
+
return;
|
|
43
40
|
}
|
|
44
|
-
|
|
41
|
+
let t = g();
|
|
42
|
+
c.write(`${h()}${e}\n${t}`), f = n(t, c.columns);
|
|
45
43
|
},
|
|
46
44
|
stop() {
|
|
47
|
-
clearTimeout(h);
|
|
48
|
-
for (let [e, t] of g) process.off(e, t);
|
|
49
|
-
g = [], m && (m = !1, l.write(`${_()}[?25h`));
|
|
45
|
+
clearTimeout(m), p && (p = !1, c.write(`${h()}[?25h`));
|
|
50
46
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
l.write(`${e}\n`);
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
let t = v();
|
|
57
|
-
l.write(`${_()}${e}\n${t}`), p = n(t, l.columns);
|
|
47
|
+
start() {
|
|
48
|
+
return l && (p = !0, _()), v;
|
|
58
49
|
}
|
|
59
50
|
};
|
|
60
|
-
return
|
|
51
|
+
return v;
|
|
61
52
|
}
|
|
62
|
-
export {
|
|
53
|
+
export { o as createSpinner };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { createColors as e, isColorSupported as t } from "./create-colors.js";
|
|
2
|
+
import { isUnicodeSupported as n } from "./is-unicode-supported.js";
|
|
3
3
|
function r(r) {
|
|
4
4
|
let { platform: i, argv: a, env: o } = process, s = Infinity;
|
|
5
5
|
return r.isTTY === !0 && (s = (r.columns ?? 0) > 0 ? r.columns : 80), {
|
|
6
|
-
colors: t(
|
|
6
|
+
colors: e(t({
|
|
7
7
|
stdout: r,
|
|
8
8
|
platform: i,
|
|
9
9
|
argv: a,
|
|
10
10
|
env: o
|
|
11
11
|
})),
|
|
12
|
-
unicode:
|
|
12
|
+
unicode: n(),
|
|
13
13
|
width: s
|
|
14
14
|
};
|
|
15
15
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Watch of the signals that interrupt a run.
|
|
3
|
+
*/
|
|
4
|
+
interface Interrupts {
|
|
5
|
+
/**
|
|
6
|
+
* Aborted on the first signal.
|
|
7
|
+
*/
|
|
8
|
+
signal: AbortSignal;
|
|
9
|
+
/**
|
|
10
|
+
* Ends the watch once the run is over. Without a signal, it removes the
|
|
11
|
+
* listeners of the watch and returns false. After a signal, it ends the
|
|
12
|
+
* process by that signal, as the process would end without the listeners;
|
|
13
|
+
* where the signal does not end it, on Windows, which cannot raise a signal
|
|
14
|
+
* again, or while another listener of the signal remains, it exits with the
|
|
15
|
+
* code a shell gives for the signal, 128 plus its number.
|
|
16
|
+
*
|
|
17
|
+
* @returns False when no signal came.
|
|
18
|
+
*/
|
|
19
|
+
end(): boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Watches SIGHUP, SIGINT and SIGTERM for a run, so that it can stop its test
|
|
23
|
+
* processes and remove its files before the process ends. The first signal sets
|
|
24
|
+
* the exit code a shell gives for it, 128 plus its number, and aborts the
|
|
25
|
+
* returned signal; later ones are ignored while the run cleans up, since npm
|
|
26
|
+
* and other wrappers send the terminal's SIGINT a second time. The cleanup gets
|
|
27
|
+
* 5 seconds: past them, such as when a global teardown hangs, the work
|
|
28
|
+
* directories of the run are removed at once (`removeLiveWorkDirectories`) and
|
|
29
|
+
* the process ends by the signal anyway. They are removed too when something
|
|
30
|
+
* else ends the process meanwhile, such as a listener of the project's code
|
|
31
|
+
* that exits. The listeners stay until the process ends, as a listener that
|
|
32
|
+
* removed itself would let other listeners raise the signal again before the
|
|
33
|
+
* cleanup. SIGQUIT, the quit key, keeps ending the process at once. Errors of
|
|
34
|
+
* writes to standard error are ignored from the start: after a terminal closed
|
|
35
|
+
* a write fails with EIO, which would otherwise end the process before the run
|
|
36
|
+
* cleaned up.
|
|
37
|
+
*
|
|
38
|
+
* @returns The watch, with the signal to pass to the run.
|
|
39
|
+
*/
|
|
40
|
+
export declare function watchInterrupts(): Interrupts;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { removeLiveWorkDirectories as e } from "../core/run/remove-live-work-directories.js";
|
|
2
|
+
import { constants as t } from "node:os";
|
|
3
|
+
const n = [
|
|
4
|
+
"SIGHUP",
|
|
5
|
+
"SIGINT",
|
|
6
|
+
"SIGTERM"
|
|
7
|
+
];
|
|
8
|
+
function r() {
|
|
9
|
+
let r = new AbortController(), i = null, a;
|
|
10
|
+
function o(n) {
|
|
11
|
+
i === null && (i = n, process.exitCode = 128 + t.signals[n], a = setTimeout(() => {
|
|
12
|
+
e(), s(n);
|
|
13
|
+
}, 5e3), r.abort());
|
|
14
|
+
}
|
|
15
|
+
function s(e) {
|
|
16
|
+
clearTimeout(a);
|
|
17
|
+
for (let e of n) process.off(e, o);
|
|
18
|
+
process.platform !== "win32" && process.kill(process.pid, e), process.exit();
|
|
19
|
+
}
|
|
20
|
+
function c() {}
|
|
21
|
+
process.stderr.on("error", c), process.on("exit", e);
|
|
22
|
+
for (let e of n) process.on(e, o);
|
|
23
|
+
return {
|
|
24
|
+
end: () => {
|
|
25
|
+
if (i !== null) return s(i), !0;
|
|
26
|
+
for (let e of n) process.off(e, o);
|
|
27
|
+
return process.off("exit", e), process.stderr.off("error", c), !1;
|
|
28
|
+
},
|
|
29
|
+
signal: r.signal
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export { r as watchInterrupts };
|
|
@@ -2,13 +2,14 @@ import { RunState } from '../../types/run/run-state.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Applies cached isolated evidence before the isolated rounds, by the rule of
|
|
4
4
|
* fresh units (`decideEvidence`): for every undecided mutant on the isolated
|
|
5
|
-
* path, a valid cached kill in one of its test files is that file's
|
|
6
|
-
* and a valid cached reached pass counts as `Survived` evidence;
|
|
7
|
-
* its test file off the list. The cache
|
|
8
|
-
*
|
|
9
|
-
* kill
|
|
10
|
-
*
|
|
11
|
-
* left with nothing to run
|
|
5
|
+
* path, a valid cached kill or timeout in one of its test files is that file's
|
|
6
|
+
* evidence, and a valid cached reached pass counts as `Survived` evidence;
|
|
7
|
+
* either takes its test file off the list. The cache holds no error and no
|
|
8
|
+
* timeout but a confirmed one by the hit limit, so a file before the first
|
|
9
|
+
* cached kill or timeout without a valid entry still runs, and the cached one
|
|
10
|
+
* decides only if that file brings no kill or timeout of its own; files after
|
|
11
|
+
* it can no longer decide and are dropped. A mutant left with nothing to run
|
|
12
|
+
* that never ran is `cached`.
|
|
12
13
|
*
|
|
13
14
|
* @param state - State of the run with its cache, updated in place.
|
|
14
15
|
*/
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hash of the code of mootant's build, which the build writes in place of this
|
|
3
|
+
* text (`vite.config.ts`), so a reinstall of the same package keeps the cache
|
|
4
|
+
* keys and a build of other code under the same version changes them. Sources
|
|
5
|
+
* keep this text, and `getBuildId` gives them an id of their own. Pass it on
|
|
6
|
+
* only as a value: the build may inline a constant that code compares and fold
|
|
7
|
+
* the comparison before the hash is written.
|
|
8
|
+
*/
|
|
9
|
+
export declare const BUILD_HASH: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Version of the cache file
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Version of the format of the cache file and of the saved dry run, and of the
|
|
3
|
+
* recipe of their keys; it is part of their file names, so a file of another
|
|
4
|
+
* version is never read. Bump it when any of them changes.
|
|
5
5
|
*/
|
|
6
|
-
export declare const CACHE_VERSION =
|
|
6
|
+
export declare const CACHE_VERSION = 8;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ProjectTree } from '../../types/cache/project-tree.js';
|
|
2
|
+
import { DrySnapshot } from '../../types/cache/dry-snapshot.js';
|
|
3
|
+
/**
|
|
4
|
+
* Tells whether the inputs of a saved dry run (`DrySnapshot`) are unchanged,
|
|
5
|
+
* the cheapest check first, before a run builds its switched files for the key:
|
|
6
|
+
* the environment variables of the main process, the files the dry run and the
|
|
7
|
+
* cache keys depended on, then everything under the project root
|
|
8
|
+
* (`hashProjectTree`), which a run that starts the test runner hashes anyway. A
|
|
9
|
+
* file that is now a device, a pipe or a socket (`UNKNOWN_HASH`) has another
|
|
10
|
+
* hash than any saved one, which never names such a file.
|
|
11
|
+
*
|
|
12
|
+
* @param snapshot - Saved dry run of an earlier run.
|
|
13
|
+
* @param run - Environment, root and tree of this run.
|
|
14
|
+
* @param run.environment - Environment variables of the main process as the run
|
|
15
|
+
* started, before a test runner could set any.
|
|
16
|
+
* @param run.root - Project root, for the paths of the reason.
|
|
17
|
+
* @param run.tree - Hashes everything under the project root, once per run.
|
|
18
|
+
* @returns Null when the inputs are unchanged, else the end of a sentence that
|
|
19
|
+
* tells what changed, such as `src/a.test.ts changed`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function checkDrySnapshot(snapshot: DrySnapshot, run: {
|
|
22
|
+
tree(): Promise<ProjectTree | null>;
|
|
23
|
+
environment: NodeJS.ProcessEnv;
|
|
24
|
+
root: string;
|
|
25
|
+
}): Promise<string | null>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { listVariableHashes as e } from "./list-variable-hashes.js";
|
|
2
|
+
import { getDisplayPath as t } from "../run/get-display-path.js";
|
|
3
|
+
import { createDigest as n } from "./create-digest.js";
|
|
4
|
+
import { hashFiles as r } from "./hash-files.js";
|
|
5
|
+
async function i(i, a) {
|
|
6
|
+
let o = e(i.variables.map(([e]) => e), a.environment);
|
|
7
|
+
if (n(o) !== n(i.variables)) return "an environment variable changed";
|
|
8
|
+
let s = await r(i.files.map(([e]) => e)), c = i.files.find(([e, t]) => s.get(e) !== t);
|
|
9
|
+
if (c !== void 0) return `${t(c[0], a.root)} changed`;
|
|
10
|
+
let l = await a.tree();
|
|
11
|
+
return l === null ? "mootant cannot read every directory and link of the project" : l.hash === i.tree ? null : "a file of the project was added, removed or changed";
|
|
12
|
+
}
|
|
13
|
+
export { i as checkDrySnapshot };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates the error thrown inside a run that replays a saved dry run once the
|
|
3
|
+
* saved dry run turns out to be stale, a mutant has no valid cached verdict and
|
|
4
|
+
* needs the test runner, or the replay fails otherwise. The run then starts
|
|
5
|
+
* over with the test runner; nothing ran or was written before. The message is
|
|
6
|
+
* the note the run gives.
|
|
7
|
+
*
|
|
8
|
+
* @param reason - Why the saved dry run cannot decide the run, as the end of a
|
|
9
|
+
* sentence, such as `src/a.test.ts changed`.
|
|
10
|
+
* @returns Error named `DryReuseMiss`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createDryReuseMiss(reason: string): Error;
|