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
|
@@ -23,14 +23,19 @@ export interface FileAccessReceiver {
|
|
|
23
23
|
* `open` reads unless its flags create, empty or append to the file, as `w`,
|
|
24
24
|
* `a` or `O_CREAT` do; `r+` reads. The source of a copy, a move or a link is
|
|
25
25
|
* read, and so is every file and directory in a directory `cp` copies, outside
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* the
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
26
|
+
* `.git`, and outside `node_modules` too with a `filter`, whose copies it
|
|
27
|
+
* writes once it succeeded, unless a `filter`, `force: false` or
|
|
28
|
+
* `verbatimSymlinks` may make a copy other than its source (`listCopies`);
|
|
29
|
+
* `mkdir` writes only the directories that did not exist. `mkdtemp` and
|
|
30
|
+
* `mkdtempDisposable` write the directory they made once they give it. A
|
|
31
|
+
* recursive `readdir` or `opendir` reads the directory and every directory in
|
|
32
|
+
* it, each listed by its own names, so adding a file anywhere in the tree
|
|
33
|
+
* changes what was read; `readdir` also reads the directories behind the links
|
|
34
|
+
* it follows. `glob` reads the same of the directory where each pattern's fixed
|
|
35
|
+
* part ends. Calls of `node:fs` that a wrapped function makes while it runs
|
|
36
|
+
* report nothing, and neither do those of the asynchronous work of `glob` and
|
|
37
|
+
* `cp`, but those of their callbacks do. Descriptors and file handles are not
|
|
38
|
+
* paths and are not reported.
|
|
34
39
|
*
|
|
35
40
|
* @param receiver - Receives the paths while it is the current receiver; the
|
|
36
41
|
* next call replaces it, and null stops recording.
|
|
@@ -26,18 +26,18 @@ const a = /* @__PURE__ */ new Set([
|
|
|
26
26
|
rmdir: [0],
|
|
27
27
|
mkdir: [0],
|
|
28
28
|
link: [1],
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
rm: [0],
|
|
30
|
+
cp: []
|
|
31
31
|
}, s = /* @__PURE__ */ new Set([
|
|
32
32
|
"copyFile",
|
|
33
33
|
"symlink",
|
|
34
34
|
"rename",
|
|
35
35
|
"link",
|
|
36
36
|
"cp"
|
|
37
|
-
]), c = /* @__PURE__ */ new Set(["
|
|
38
|
-
let
|
|
39
|
-
function
|
|
40
|
-
let r = globalThis, s = r[
|
|
37
|
+
]), c = /* @__PURE__ */ new Set(["mkdtempDisposable", "mkdtemp"]), l = /* @__PURE__ */ new Set(["glob", "cp"]), u = /* @__PURE__ */ new Set([".git"]), d = /* @__PURE__ */ new Set([...u, "node_modules"]), f = /[!()*+?@[\\\]{}]/u, p = t.constants.O_WRONLY | t.constants.O_APPEND | t.constants.O_CREAT | t.constants.O_TRUNC, m = Symbol.for("mootant.file-reads");
|
|
38
|
+
let h = n.resolve, g = n.dirname, _ = n.join, v = r;
|
|
39
|
+
function y(n) {
|
|
40
|
+
let r = globalThis, s = r[m];
|
|
41
41
|
if (s === void 0) {
|
|
42
42
|
s = {
|
|
43
43
|
original: {
|
|
@@ -46,39 +46,78 @@ function g(n) {
|
|
|
46
46
|
existsSync: t.existsSync,
|
|
47
47
|
statSync: t.statSync
|
|
48
48
|
},
|
|
49
|
-
|
|
49
|
+
walking: new i(),
|
|
50
50
|
receiver: null,
|
|
51
51
|
inside: !1
|
|
52
|
-
}, r[
|
|
53
|
-
let n = [
|
|
52
|
+
}, r[m] = s;
|
|
53
|
+
let n = [
|
|
54
|
+
...a,
|
|
55
|
+
...Object.keys(o),
|
|
56
|
+
...c
|
|
57
|
+
].flatMap((e) => [e, `${e}Sync`]);
|
|
54
58
|
for (let e of [t, t.promises]) for (let t of n) {
|
|
55
59
|
let n = Reflect.get(e, t);
|
|
56
|
-
typeof n == "function" && Reflect.set(e, t,
|
|
60
|
+
typeof n == "function" && Reflect.set(e, t, b(n, t, s));
|
|
57
61
|
}
|
|
58
62
|
e();
|
|
59
63
|
}
|
|
60
64
|
s.receiver = n;
|
|
61
65
|
}
|
|
62
|
-
function
|
|
66
|
+
function b(e, t, n) {
|
|
63
67
|
let r = t.replace(/Sync$/u, "");
|
|
64
68
|
function i(...i) {
|
|
65
|
-
if (n.inside || n.
|
|
66
|
-
let a = n.receiver;
|
|
67
|
-
if (a !== null)
|
|
68
|
-
let e =
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
if (n.inside || n.walking.getStore() === !0) return e.apply(this, i);
|
|
70
|
+
let a = n.receiver, o = null;
|
|
71
|
+
if (a !== null) {
|
|
72
|
+
let e = a;
|
|
73
|
+
try {
|
|
74
|
+
if (c.has(r)) o = (t) => {
|
|
75
|
+
let n = t.path ?? t, r = h(Buffer.isBuffer(n) ? n.toString() : String(n));
|
|
76
|
+
e.write(r);
|
|
77
|
+
};
|
|
78
|
+
else {
|
|
79
|
+
let t = j(r, i, n);
|
|
80
|
+
for (let n of t.read) e.read(n);
|
|
81
|
+
for (let n of t.written) e.write(n);
|
|
82
|
+
let a = r === "cp" ? T(i, t.read, n) : [];
|
|
83
|
+
a.length > 0 && (o = () => {
|
|
84
|
+
for (let t of a) e.write(t);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
} catch {}
|
|
88
|
+
}
|
|
89
|
+
let s = (t) => o === null ? e.apply(this, t) : x((...t) => e.apply(this, t), t, o);
|
|
72
90
|
n.inside = !0;
|
|
73
91
|
try {
|
|
74
|
-
|
|
92
|
+
if (!l.has(t)) return s(i);
|
|
93
|
+
let e = M(i, n), r = n.walking.run(!0, () => s(e));
|
|
94
|
+
return t === "glob" ? k(r, n) : r;
|
|
75
95
|
} finally {
|
|
76
96
|
n.inside = !1;
|
|
77
97
|
}
|
|
78
98
|
}
|
|
79
99
|
return Object.defineProperties(i, Object.getOwnPropertyDescriptors(e)), i;
|
|
80
100
|
}
|
|
81
|
-
function
|
|
101
|
+
function x(e, t, n) {
|
|
102
|
+
function r(e) {
|
|
103
|
+
try {
|
|
104
|
+
n(e);
|
|
105
|
+
} catch {}
|
|
106
|
+
}
|
|
107
|
+
let i = t.at(-1);
|
|
108
|
+
if (typeof i == "function") return e(...t.slice(0, -1), (e, t, ...n) => (e ?? r(t), Reflect.apply(i, void 0, [
|
|
109
|
+
e,
|
|
110
|
+
t,
|
|
111
|
+
...n
|
|
112
|
+
])));
|
|
113
|
+
async function a(e) {
|
|
114
|
+
let t = await e;
|
|
115
|
+
return r(t), t;
|
|
116
|
+
}
|
|
117
|
+
let o = e(...t);
|
|
118
|
+
return o instanceof Promise ? a(o) : (r(o), o);
|
|
119
|
+
}
|
|
120
|
+
function S(e, t, n) {
|
|
82
121
|
let r = [e], i = /* @__PURE__ */ new Set(), a = [e];
|
|
83
122
|
for (; a.length > 0;) {
|
|
84
123
|
let e = a.shift(), o = [];
|
|
@@ -86,7 +125,7 @@ function v(e, t, n) {
|
|
|
86
125
|
i.add(t.original.realpathSync(e)), o = t.original.readdirSync(e, { withFileTypes: !0 });
|
|
87
126
|
} catch {}
|
|
88
127
|
for (let s of o) {
|
|
89
|
-
let o =
|
|
128
|
+
let o = _(e, s.name), c = s.isDirectory();
|
|
90
129
|
if (n && s.isSymbolicLink()) try {
|
|
91
130
|
if (c = t.original.statSync(o).isDirectory(), c && i.has(t.original.realpathSync(o))) {
|
|
92
131
|
r.push(o);
|
|
@@ -98,93 +137,107 @@ function v(e, t, n) {
|
|
|
98
137
|
}
|
|
99
138
|
return r;
|
|
100
139
|
}
|
|
101
|
-
function
|
|
102
|
-
|
|
103
|
-
let r = [];
|
|
140
|
+
function C(e, t, n) {
|
|
141
|
+
let r = [e], i = [];
|
|
104
142
|
try {
|
|
105
|
-
t.original.statSync(e).isDirectory() &&
|
|
143
|
+
t.original.statSync(e).isDirectory() && i.push(e);
|
|
106
144
|
} catch {}
|
|
107
|
-
for (;
|
|
108
|
-
let e =
|
|
145
|
+
for (; i.length > 0;) {
|
|
146
|
+
let e = i.shift(), a = [];
|
|
109
147
|
try {
|
|
110
|
-
|
|
148
|
+
a = t.original.readdirSync(e, { withFileTypes: !0 });
|
|
111
149
|
} catch {}
|
|
112
|
-
for (let t of
|
|
113
|
-
let
|
|
114
|
-
|
|
150
|
+
for (let t of a) if (!n.has(t.name)) {
|
|
151
|
+
let n = _(e, t.name);
|
|
152
|
+
r.push(n), t.isDirectory() && i.push(n);
|
|
115
153
|
}
|
|
116
154
|
}
|
|
155
|
+
return r;
|
|
117
156
|
}
|
|
118
|
-
function
|
|
119
|
-
let r =
|
|
120
|
-
written: [],
|
|
121
|
-
read: []
|
|
122
|
-
}, i = D(t[0]);
|
|
123
|
-
return i === null || (e === "open" && !k(t[1]) ? r.written.push(i) : (e === "readdir" || e === "opendir") && t[1]?.recursive ? r.read.push(...v(i, n, e === "readdir")) : r.read.push(i)), r;
|
|
124
|
-
}
|
|
125
|
-
function x(e, t, n) {
|
|
126
|
-
let r = D(t[0]);
|
|
157
|
+
function w(e, t, n) {
|
|
158
|
+
let r = N(t[0]);
|
|
127
159
|
if (r === null || !s.has(e)) return [];
|
|
128
160
|
if (e === "symlink") {
|
|
129
|
-
let e =
|
|
130
|
-
return [e === null || typeof t[0] != "string" ? r :
|
|
161
|
+
let e = N(t[1]);
|
|
162
|
+
return [e === null || typeof t[0] != "string" ? r : h(g(e), t[0])];
|
|
131
163
|
}
|
|
132
164
|
if (e === "cp") {
|
|
133
|
-
let e = [];
|
|
134
|
-
return
|
|
165
|
+
let e = t[2];
|
|
166
|
+
return C(r, n, typeof e == "object" && e && Reflect.get(e, "filter") !== void 0 ? d : u);
|
|
135
167
|
}
|
|
136
168
|
return [r];
|
|
137
169
|
}
|
|
138
|
-
function
|
|
139
|
-
let
|
|
140
|
-
|
|
170
|
+
function T(e, t, n) {
|
|
171
|
+
let [r] = t, i = N(e[1]), a = e[2] ?? {};
|
|
172
|
+
return r === void 0 || i === null || a.filter !== void 0 || a.force === !1 || a.verbatimSymlinks === !0 ? [] : t.map((e) => `${i}${e.slice(r.length)}`).filter((e) => {
|
|
173
|
+
try {
|
|
174
|
+
return !n.original.statSync(e).isDirectory();
|
|
175
|
+
} catch {
|
|
176
|
+
return !0;
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function E(e, t, n) {
|
|
181
|
+
let r = {
|
|
182
|
+
written: [],
|
|
183
|
+
read: []
|
|
184
|
+
}, i = N(t[0]);
|
|
185
|
+
return i === null || (e === "open" && !F(t[1]) ? r.written.push(i) : (e === "readdir" || e === "opendir") && t[1]?.recursive ? r.read.push(...S(i, n, e === "readdir")) : r.read.push(i)), r;
|
|
186
|
+
}
|
|
187
|
+
function D(e, t) {
|
|
188
|
+
let n = [], r = [e[0]].flat(), i = e[1], a = typeof i == "object" ? N(i.cwd) : null;
|
|
189
|
+
for (let e of r) typeof e == "string" && n.push(...S(A(e, a ?? process.cwd()), t, !1));
|
|
141
190
|
return n;
|
|
142
191
|
}
|
|
143
|
-
function
|
|
192
|
+
function O(e, t, n) {
|
|
144
193
|
let r = [], i = o[e];
|
|
145
194
|
for (let a of i) {
|
|
146
|
-
let i =
|
|
195
|
+
let i = N(t[a]);
|
|
147
196
|
if (i !== null) {
|
|
148
|
-
if (e === "mkdir") for (; !n.original.existsSync(i);) r.push(i), i =
|
|
197
|
+
if (e === "mkdir") for (; !n.original.existsSync(i);) r.push(i), i = g(i);
|
|
149
198
|
else r.push(i);
|
|
150
199
|
}
|
|
151
200
|
}
|
|
152
201
|
return r;
|
|
153
202
|
}
|
|
154
|
-
function
|
|
203
|
+
function k(e, t) {
|
|
155
204
|
if (e === void 0) return e;
|
|
156
205
|
let n = e, r = {
|
|
157
|
-
return: (e) => t.
|
|
158
|
-
next: () => t.
|
|
206
|
+
return: (e) => t.walking.run(!0, () => n.return(e)),
|
|
207
|
+
next: () => t.walking.run(!0, () => n.next()),
|
|
159
208
|
[Symbol.asyncIterator]: () => r
|
|
160
209
|
};
|
|
161
210
|
return r;
|
|
162
211
|
}
|
|
163
|
-
function
|
|
164
|
-
let n = e.split("/"), r = n.findIndex((e) =>
|
|
165
|
-
if (r === -1) return
|
|
166
|
-
let i =
|
|
167
|
-
for (let e of n.slice(r)) e === ".." && (i =
|
|
212
|
+
function A(e, t) {
|
|
213
|
+
let n = e.split("/"), r = n.findIndex((e) => f.test(e));
|
|
214
|
+
if (r === -1) return h(t, e);
|
|
215
|
+
let i = h(t, n.slice(0, r).join("/"));
|
|
216
|
+
for (let e of n.slice(r)) e === ".." && (i = g(i));
|
|
168
217
|
return i;
|
|
169
218
|
}
|
|
170
|
-
function
|
|
219
|
+
function j(e, t, n) {
|
|
171
220
|
return e === "glob" ? {
|
|
172
|
-
read:
|
|
221
|
+
read: D(t, n),
|
|
173
222
|
written: []
|
|
174
|
-
} : a.has(e) ?
|
|
175
|
-
read:
|
|
176
|
-
written:
|
|
223
|
+
} : a.has(e) ? E(e, t, n) : {
|
|
224
|
+
read: w(e, t, n),
|
|
225
|
+
written: O(e, t, n)
|
|
177
226
|
};
|
|
178
227
|
}
|
|
179
|
-
function
|
|
228
|
+
function M(e, t) {
|
|
229
|
+
let n = e.at(-1);
|
|
230
|
+
return typeof n == "function" ? [...e.slice(0, -1), (...e) => t.walking.exit(() => Reflect.apply(n, void 0, e))] : e;
|
|
231
|
+
}
|
|
232
|
+
function N(e) {
|
|
180
233
|
let t = null;
|
|
181
|
-
return typeof e == "string" ? t = e :
|
|
234
|
+
return typeof e == "string" ? t = e : P(e) ? t = e.protocol === "file:" ? v(e) : null : e instanceof Buffer && (t = e.toString()), t === null ? null : h(t);
|
|
182
235
|
}
|
|
183
|
-
function
|
|
236
|
+
function P(e) {
|
|
184
237
|
let t = e;
|
|
185
238
|
return !!t?.href && !!t?.protocol && t?.auth === void 0 && t?.path === void 0;
|
|
186
239
|
}
|
|
187
|
-
function
|
|
188
|
-
return typeof e == "number" ? (e &
|
|
240
|
+
function F(e) {
|
|
241
|
+
return typeof e == "number" ? (e & p) === 0 : typeof e != "string" || !/[aw]/u.test(e);
|
|
189
242
|
}
|
|
190
|
-
export {
|
|
243
|
+
export { y as trackFileReads };
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { InputTracking } from './types/input-tracking.js';
|
|
2
2
|
import { trackEnvironment } from './track-environment.js';
|
|
3
3
|
/**
|
|
4
|
-
* Starts recording what the code of a test process or worker reads: the
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Starts recording what the code of a test process or worker reads: the files
|
|
5
|
+
* and directories read through `node:fs` that count as inputs, inside the
|
|
6
|
+
* project root or outside it (`createInputFilter`), those of them it changed
|
|
7
|
+
* itself, and the environment variables, apart from those the test runner reads
|
|
8
|
+
* on its own.
|
|
8
9
|
*
|
|
9
|
-
* @param
|
|
10
|
+
* @param places - Project root and work directory of the run, which decide what
|
|
11
|
+
* counts.
|
|
12
|
+
* @param places.directory - Work directory of the run.
|
|
13
|
+
* @param places.root - Project root.
|
|
10
14
|
* @param environment - Variables the test runner reads on its own and the
|
|
11
15
|
* holder of its `metaEnv`, if any, as `trackEnvironment` takes them; passed
|
|
12
16
|
* to both of its calls.
|
|
13
17
|
* @returns The files read so far, `process.env` as Node made it, and the
|
|
14
18
|
* function that stops recording and returns what was read.
|
|
15
19
|
*/
|
|
16
|
-
export declare function trackInputs(
|
|
20
|
+
export declare function trackInputs(places: {
|
|
21
|
+
directory: string;
|
|
22
|
+
root: string;
|
|
23
|
+
}, environment: Parameters<typeof trackEnvironment>[0]): InputTracking;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import n from "
|
|
1
|
+
import { createInputFilter as e } from "./create-input-filter.js";
|
|
2
|
+
import { trackEnvironment as t } from "./track-environment.js";
|
|
3
|
+
import { trackFileInputs as n } from "./track-file-inputs.js";
|
|
4
4
|
function r(r, i) {
|
|
5
|
-
let a = /* @__PURE__ */ new Set(), o =
|
|
5
|
+
let a = /* @__PURE__ */ new Set(), o = n(e(r)), s = t(i, (e) => {
|
|
6
6
|
a.add(e);
|
|
7
7
|
});
|
|
8
8
|
return {
|
|
9
9
|
stop: () => {
|
|
10
|
-
let { modified:
|
|
11
|
-
return
|
|
10
|
+
let { modified: e, files: n } = o.stop();
|
|
11
|
+
return t(i, null), {
|
|
12
12
|
environment: [...a].toSorted(),
|
|
13
|
-
modified:
|
|
13
|
+
modified: e,
|
|
14
14
|
files: n
|
|
15
15
|
};
|
|
16
16
|
},
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Remembers a test process, which leads a process group of its own and so gets
|
|
3
3
|
* no signal the terminal sends, until it ends: while any is remembered, this
|
|
4
|
-
* process stops them all when it exits or gets SIGINT or
|
|
4
|
+
* process stops them all when it exits or gets SIGHUP, SIGINT, SIGQUIT or
|
|
5
|
+
* SIGTERM.
|
|
5
6
|
*
|
|
6
7
|
* @param pid - Process id of the test process.
|
|
7
8
|
* @returns Function that forgets the process once it ended.
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { stopLiveProcessGroups as e } from "./stop-live-process-groups.js";
|
|
2
2
|
import { LIVE_PROCESS_GROUPS as t } from "./live-process-groups.js";
|
|
3
|
-
const n = [
|
|
3
|
+
const n = [
|
|
4
|
+
"SIGHUP",
|
|
5
|
+
"SIGINT",
|
|
6
|
+
"SIGQUIT",
|
|
7
|
+
"SIGTERM"
|
|
8
|
+
];
|
|
4
9
|
function r(r) {
|
|
5
10
|
if (!process.listeners("exit").includes(e)) {
|
|
6
11
|
process.on("exit", e);
|
|
@@ -11,7 +16,7 @@ function r(r) {
|
|
|
11
16
|
};
|
|
12
17
|
}
|
|
13
18
|
function i(t) {
|
|
14
|
-
e(), a(), process.listenerCount(t) === 0 && process.kill(process.pid, t);
|
|
19
|
+
e(), a(), process.listenerCount(t) === 0 && process.kill(process.pid, process.platform === "win32" ? "SIGINT" : t);
|
|
15
20
|
}
|
|
16
21
|
function a() {
|
|
17
22
|
process.off("exit", e);
|
|
@@ -11,6 +11,12 @@ export interface FileInputTracking {
|
|
|
11
11
|
*/
|
|
12
12
|
stop(): { modified: string[]; files: string[] }
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Tells whether the code wrote a path itself, by the path it gave or by the
|
|
16
|
+
* real path of its directory, also after `stop`.
|
|
17
|
+
*/
|
|
18
|
+
owns(file: string): boolean
|
|
19
|
+
|
|
14
20
|
/**
|
|
15
21
|
* Files and directories read so far, a missing one included, that the filter
|
|
16
22
|
* accepted and the code had not written before; the set stays live until
|
|
@@ -13,9 +13,9 @@ export interface InputTracking {
|
|
|
13
13
|
stop(): { environment: string[]; modified: string[]; files: string[] }
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
* included, that the code had not
|
|
18
|
-
* `stop`.
|
|
16
|
+
* Files and directories read so far through `node:fs` that count as inputs
|
|
17
|
+
* (`createInputFilter`), a missing one included, that the code had not
|
|
18
|
+
* written before; the set stays live until `stop`.
|
|
19
19
|
*/
|
|
20
20
|
files: ReadonlySet<string>
|
|
21
21
|
|
|
@@ -7,9 +7,10 @@ import { UnitOutcome } from './types/unit-outcome.js';
|
|
|
7
7
|
* stopped its worker, else `crash`. A failed cleanup of worker-scoped fixtures
|
|
8
8
|
* or a failed teardown of the test environment is the unit's hook error; a
|
|
9
9
|
* suite hook that hit Vitest's hook timeout marks the unit as timed out. A unit
|
|
10
|
-
* that ended reports how long its process took to start: from the moment
|
|
11
|
-
*
|
|
12
|
-
* waited for its turn
|
|
10
|
+
* that ended reports how long its process took to start: from the moment its
|
|
11
|
+
* task got the worker from the pool, a spare one included, to the moment the
|
|
12
|
+
* worker began the unit, before it waited for its turn, both on the wall
|
|
13
|
+
* clock.
|
|
13
14
|
*
|
|
14
15
|
* @param handle - Live Vitest instance of the session.
|
|
15
16
|
* @param unit - Index of the unit in the plan.
|
|
@@ -6,9 +6,16 @@ import { TestProject } from 'vitest/node';
|
|
|
6
6
|
* module graph, transitively, which takes in files plugins watch and literal
|
|
7
7
|
* dynamic imports that did not run, with all they import: modules that were
|
|
8
8
|
* never transformed are transformed first, so their imports are known. Each
|
|
9
|
-
* directory of those files
|
|
10
|
-
*
|
|
11
|
-
* `
|
|
9
|
+
* directory of those files, of TypeScript files only under `node_modules`, adds
|
|
10
|
+
* the `tsconfig.json` files that may decide how Vite transforms it
|
|
11
|
+
* (`listTsconfigFiles`). Virtual modules (`isVirtualModule`) are followed but
|
|
12
|
+
* not listed, so the files plugins watch for them are in; files under
|
|
13
|
+
* `node_modules` are listed but not followed, as Vite transforms none of the
|
|
14
|
+
* packages Node loads, so what they import is in only when the worker reported
|
|
15
|
+
* it, each with the `package.json` files that decide its format and its `#`
|
|
16
|
+
* imports (`listPackageFiles`) and the `package.json` of its package, which
|
|
17
|
+
* decides what an import of the package resolves to (`getPackageManifest`), as
|
|
18
|
+
* Node, not Vite, resolves and loads what Vitest leaves to it. The test file
|
|
12
19
|
* itself is always in.
|
|
13
20
|
*
|
|
14
21
|
* @param input - Test file, its project and what its worker reported.
|
|
@@ -1,38 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import r from "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { getPackageManifest as e } from "../../core/files/get-package-manifest.js";
|
|
2
|
+
import { listPackageFiles as t } from "../../core/files/list-package-files.js";
|
|
3
|
+
import { listTsconfigFiles as n } from "../shared/list-tsconfig-files.js";
|
|
4
|
+
import { compareCodeUnits as r } from "../../core/compare-code-units.js";
|
|
5
|
+
import { isVirtualModule as i } from "./is-virtual-module.js";
|
|
6
|
+
import { getModuleFile as a } from "./get-module-file.js";
|
|
7
|
+
import o from "node:path";
|
|
8
|
+
const s = /[/\\]node_modules[/\\]/u, c = /\.[cm]?tsx?$/u;
|
|
9
|
+
async function l(l) {
|
|
10
|
+
let { reported: u, project: d } = l;
|
|
11
|
+
if (u == null) return null;
|
|
12
|
+
let f = /* @__PURE__ */ new Set([l.file]);
|
|
13
|
+
function p(e) {
|
|
14
|
+
let t = a(e);
|
|
15
|
+
return t === null ? i(e) : (f.add(t), !s.test(t));
|
|
12
16
|
}
|
|
13
|
-
let
|
|
14
|
-
async function
|
|
17
|
+
let m = Object.values(d.vite.environments), h = /* @__PURE__ */ new Set();
|
|
18
|
+
async function g(e, t) {
|
|
15
19
|
if (e.transformResult === null) try {
|
|
16
20
|
await t.transformRequest(e.url);
|
|
17
21
|
} catch {}
|
|
18
|
-
let n = [...e.importedModules].filter((e) => !
|
|
19
|
-
for (let e of n)
|
|
20
|
-
await Promise.all(n.map((e) =>
|
|
22
|
+
let n = [...e.importedModules].filter((e) => !h.has(e) && p(e.file ?? e.id ?? ""));
|
|
23
|
+
for (let e of n) h.add(e);
|
|
24
|
+
await Promise.all(n.map((e) => g(e, t)));
|
|
21
25
|
}
|
|
22
|
-
let
|
|
23
|
-
for (let e of
|
|
26
|
+
let _ = [];
|
|
27
|
+
for (let e of u) if (p(e)) for (let t of m) {
|
|
24
28
|
let n = t.moduleGraph.getModuleById(e);
|
|
25
29
|
if (n !== void 0) {
|
|
26
|
-
|
|
30
|
+
h.has(n) || (h.add(n), _.push(g(n, t)));
|
|
27
31
|
break;
|
|
28
32
|
}
|
|
29
33
|
}
|
|
30
|
-
await Promise.all(
|
|
31
|
-
let
|
|
32
|
-
|
|
33
|
-
let
|
|
34
|
-
|
|
34
|
+
await Promise.all(_);
|
|
35
|
+
let v = /* @__PURE__ */ new Map(), y = [...f].flatMap((n) => {
|
|
36
|
+
if (!s.test(n)) return [];
|
|
37
|
+
let r = e(n);
|
|
38
|
+
return [...t(o.dirname(n), v), ...r === null ? [] : [r]];
|
|
39
|
+
});
|
|
40
|
+
for (let e of y) f.add(e);
|
|
41
|
+
let b = new Set([...f].filter((e) => !s.test(e) || c.test(e)).map(o.dirname));
|
|
42
|
+
for (let e of b) {
|
|
43
|
+
let t = n(e, l.tsconfigs, { references: !0 });
|
|
44
|
+
for (let e of t) f.add(e);
|
|
35
45
|
}
|
|
36
|
-
return [...
|
|
46
|
+
return [...f].toSorted(r);
|
|
37
47
|
}
|
|
38
|
-
export {
|
|
48
|
+
export { l as collectDependencies };
|
|
@@ -7,8 +7,9 @@ import { VitestSessionState } from './types/vitest-session-state.js';
|
|
|
7
7
|
* no shuffled tests, so runs follow the dry run's order (concurrency, retries
|
|
8
8
|
* and repeats stay; the runner makes tests sequential where it switches mutants
|
|
9
9
|
* between tries); snapshots are never written; transformed modules are not
|
|
10
|
-
* cached on disk
|
|
11
|
-
*
|
|
10
|
+
* cached on disk. Test locations keep the project's setting: the runner turns
|
|
11
|
+
* them on in dry runs only. Changing the pool or isolation adds a
|
|
12
|
+
* `config-overridden` warning. An unsupported setting is recorded as the
|
|
12
13
|
* session error instead. Typecheck-only projects are left alone.
|
|
13
14
|
*
|
|
14
15
|
* @param project - Vitest project as resolved from the user's configuration.
|
|
@@ -9,7 +9,7 @@ function n(n, i) {
|
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
11
|
let s = t(n);
|
|
12
|
-
a.pool !== "forks" && i.diagnostics.push(r(s, "pool: 'forks'", `pool: '${a.pool}'`)), a.isolate || i.diagnostics.push(r(s, "isolate: true", "isolate: false")), a.pool = i.pool.name, a.poolRunner = i.pool, a.isolate = !0, a.runner = i.runnerPath, a.sequence.shuffle = !1, a.snapshotOptions.updateSnapshot = "none", n.globalConfig.snapshotOptions.updateSnapshot = "none", n.vitest.snapshot.options.updateSnapshot = "none", a.fsModuleCache = !1
|
|
12
|
+
a.pool !== "forks" && i.diagnostics.push(r(s, "pool: 'forks'", `pool: '${a.pool}'`)), a.isolate || i.diagnostics.push(r(s, "isolate: true", "isolate: false")), a.pool = i.pool.name, a.poolRunner = i.pool, a.isolate = !0, a.runner = i.runnerPath, a.sequence.shuffle = !1, a.snapshotOptions.updateSnapshot = "none", n.globalConfig.snapshotOptions.updateSnapshot = "none", n.vitest.snapshot.options.updateSnapshot = "none", a.fsModuleCache = !1;
|
|
13
13
|
}
|
|
14
14
|
function r(e, t, n) {
|
|
15
15
|
return {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ForksPoolWorker } from 'vitest/node';
|
|
2
|
+
import { MootantForksPool } from './types/mootant-forks-pool.js';
|
|
2
3
|
/**
|
|
3
4
|
* Creates the custom pool mootant runs every project with: Vitest's own forks
|
|
4
|
-
* workers, through Vitest's public pool API, with
|
|
5
|
+
* workers, through Vitest's public pool API, with two changes. Vitest asks a
|
|
5
6
|
* worker to stop with a `stop` message and waits for its `stopped` answer, up
|
|
6
7
|
* to a minute, without watching the process meanwhile. A worker that hangs in
|
|
7
8
|
* its teardown never answers, and the watchdog kills it; so when the process of
|
|
@@ -10,13 +11,39 @@ import { PoolRunnerInitializer, ForksPoolWorker } from 'vitest/node';
|
|
|
10
11
|
* process that exited is not stopped again: Vitest's forks worker waits for an
|
|
11
12
|
* `exit` event that a process killed by a signal has already sent. Should
|
|
12
13
|
* Vitest change its stop messages, the stop simply waits for Vitest's timer as
|
|
13
|
-
* before.
|
|
14
|
-
*
|
|
15
|
-
* the
|
|
14
|
+
* before.
|
|
15
|
+
*
|
|
16
|
+
* The pool also keeps spare workers for the tasks of the run it is told of
|
|
17
|
+
* (`prepare`): their processes start ahead and load Vitest's worker, but get
|
|
18
|
+
* the project, the test environment and the test file only once a task takes
|
|
19
|
+
* them, as messages of Vitest, so a task skips the start of a process, while no
|
|
20
|
+
* code of the project runs before. After each task takes its worker, spares
|
|
21
|
+
* start in the background for the tasks of its project still to come, as many
|
|
22
|
+
* in all as `getSpareLimit` allows for the project's `maxWorkers`; a task takes
|
|
23
|
+
* a spare whose process runs and whose key matches its own (`getSpareKey`),
|
|
24
|
+
* else starts a worker of its own. A spare that fails or ends is dropped; one
|
|
25
|
+
* that cannot start ends the spares of its project for the run. The spares left
|
|
26
|
+
* stop when the run is over (`drain`). Without spares (`MOOTANT_PREFORK=0`),
|
|
27
|
+
* with a worker whose flags rule them out, or should Vitest stop exposing the
|
|
28
|
+
* process of its first worker, every task starts its own worker.
|
|
29
|
+
*
|
|
30
|
+
* The pool notes when each task got its worker process, so the cost of a unit
|
|
31
|
+
* can include the start of its process.
|
|
32
|
+
*
|
|
33
|
+
* Once the run is interrupted (`interrupt`), the pool stops the process of
|
|
34
|
+
* every worker and spare it started that still runs, with `SIGKILL` through the
|
|
35
|
+
* process itself, which cannot stand for another process before it ended, and
|
|
36
|
+
* starts none: the start of a task fails at once, and a worker refused so has
|
|
37
|
+
* no process to stop. Vitest ends the run then as after a watchdog's kill.
|
|
38
|
+
* Should Vitest stop exposing the processes of its workers, an interrupted run
|
|
39
|
+
* waits until they end or the watchdog stops them. The watchdog stops a hung
|
|
40
|
+
* worker the same way (`stopWorker`); a process id that is none of the pool's
|
|
41
|
+
* running processes is left.
|
|
16
42
|
*
|
|
17
43
|
* @param Worker - Forks worker class of the project's Vitest.
|
|
18
|
-
* @param spawns - Receives the epoch milliseconds at which
|
|
44
|
+
* @param spawns - Receives the epoch milliseconds at which a task got its
|
|
19
45
|
* worker process, by process id.
|
|
46
|
+
* @param prefork - Whether the pool may keep spare workers.
|
|
20
47
|
* @returns Pool to set as the projects' `poolRunner`.
|
|
21
48
|
*/
|
|
22
|
-
export declare function createForksPool(Worker: typeof ForksPoolWorker, spawns: Map<number, number
|
|
49
|
+
export declare function createForksPool(Worker: typeof ForksPoolWorker, spawns: Map<number, number>, prefork: boolean): MootantForksPool;
|