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.
Files changed (487) hide show
  1. package/bin/mootant.js +3 -2
  2. package/dist/adapters/jest/build-dry-file.d.ts +12 -12
  3. package/dist/adapters/jest/collect-jest-dependencies.d.ts +15 -12
  4. package/dist/adapters/jest/collect-jest-dependencies.js +20 -14
  5. package/dist/adapters/jest/get-jest-cache-inputs.d.ts +14 -13
  6. package/dist/adapters/jest/index.d.ts +3 -1
  7. package/dist/adapters/jest/run-dry.js +20 -20
  8. package/dist/adapters/jest/runner.d.ts +1 -1
  9. package/dist/adapters/jest/runner.js +1 -1
  10. package/dist/adapters/jest/start-jest-session.d.ts +6 -2
  11. package/dist/adapters/jest/start-jest-session.js +9 -2
  12. package/dist/adapters/jest/types/jest-handle.d.ts +2 -1
  13. package/dist/adapters/jest/types/jest-record.d.ts +5 -4
  14. package/dist/adapters/jest/types/unit-worker.d.ts +16 -8
  15. package/dist/adapters/jest/types/worker-channel.d.ts +7 -0
  16. package/dist/adapters/jest/types/worker-session.d.ts +6 -7
  17. package/dist/adapters/jest/worker/boot-worker.d.ts +5 -3
  18. package/dist/adapters/jest/worker/create-test-runner.d.ts +4 -1
  19. package/dist/adapters/jest/worker/keep-reset-loads.d.ts +13 -0
  20. package/dist/adapters/jest/worker/list-runtime-files.d.ts +13 -0
  21. package/dist/adapters/jest/worker/run-unit.d.ts +24 -17
  22. package/dist/adapters/jest/worker/vm-setup.js +1 -1
  23. package/dist/adapters/jest/worker/worker.js +1 -1
  24. package/dist/adapters/jest/write-worker-session.d.ts +1 -2
  25. package/dist/adapters/jest/write-worker-session.js +2 -2
  26. package/dist/adapters/node-test/check-typescript.js +2 -2
  27. package/dist/adapters/node-test/collect-node-dependencies.d.ts +7 -5
  28. package/dist/adapters/node-test/collect-node-dependencies.js +26 -20
  29. package/dist/adapters/node-test/create-spare-processes.d.ts +26 -0
  30. package/dist/adapters/node-test/create-spare-processes.js +53 -0
  31. package/dist/adapters/node-test/filter-exec-argv.d.ts +2 -1
  32. package/dist/adapters/node-test/filter-exec-argv.js +13 -12
  33. package/dist/adapters/node-test/get-node-cache-inputs.js +1 -1
  34. package/dist/adapters/node-test/get-unit-deadline.d.ts +6 -5
  35. package/dist/adapters/node-test/index.d.ts +2 -2
  36. package/dist/adapters/node-test/index.js +1 -0
  37. package/dist/adapters/node-test/is-group-alive.d.ts +8 -0
  38. package/dist/adapters/node-test/is-group-alive.js +8 -0
  39. package/dist/adapters/node-test/list-setup-files.js +2 -2
  40. package/dist/adapters/node-test/place-preload.d.ts +2 -1
  41. package/dist/adapters/node-test/place-preload.js +24 -18
  42. package/dist/adapters/node-test/preload/create-commonjs-route.js +1 -1
  43. package/dist/adapters/node-test/preload/preload.js +54 -49
  44. package/dist/adapters/node-test/preload/read-line-sync.d.ts +11 -0
  45. package/dist/adapters/node-test/preload/read-line-sync.js +25 -0
  46. package/dist/adapters/node-test/preload/read-unit.d.ts +11 -5
  47. package/dist/adapters/node-test/preload/read-unit.js +5 -4
  48. package/dist/adapters/node-test/run-isolated.d.ts +19 -10
  49. package/dist/adapters/node-test/run-isolated.js +68 -52
  50. package/dist/adapters/node-test/run-test-file.d.ts +12 -4
  51. package/dist/adapters/node-test/run-test-file.js +19 -14
  52. package/dist/adapters/node-test/run-test-process.d.ts +30 -13
  53. package/dist/adapters/node-test/run-test-process.js +38 -40
  54. package/dist/adapters/node-test/start-node-test-session.d.ts +10 -2
  55. package/dist/adapters/node-test/start-node-test-session.js +90 -84
  56. package/dist/adapters/node-test/start-test-process.d.ts +30 -0
  57. package/dist/adapters/node-test/start-test-process.js +27 -0
  58. package/dist/adapters/node-test/types/node-test-handle.d.ts +14 -1
  59. package/dist/adapters/node-test/types/node-test-record.d.ts +3 -3
  60. package/dist/adapters/node-test/types/node-test-unit.d.ts +6 -1
  61. package/dist/adapters/node-test/types/process-watch.d.ts +4 -3
  62. package/dist/adapters/node-test/types/spare-processes.d.ts +20 -0
  63. package/dist/adapters/node-test/types/test-process-outcome.d.ts +8 -1
  64. package/dist/adapters/shared/allows-spares.d.ts +11 -0
  65. package/dist/adapters/shared/allows-spares.js +23 -0
  66. package/dist/adapters/shared/create-environment-proxy.d.ts +4 -3
  67. package/dist/adapters/shared/create-input-filter.d.ts +29 -0
  68. package/dist/adapters/shared/create-input-filter.js +32 -0
  69. package/dist/adapters/shared/enable-compile-cache.d.ts +32 -0
  70. package/dist/adapters/shared/enable-compile-cache.js +7 -0
  71. package/dist/adapters/shared/find-tsconfig-property.d.ts +13 -0
  72. package/dist/adapters/shared/find-tsconfig-property.js +6 -0
  73. package/dist/adapters/shared/get-spare-limit.d.ts +10 -0
  74. package/dist/adapters/shared/get-spare-limit.js +5 -0
  75. package/dist/adapters/shared/index-environment-hashes.d.ts +2 -2
  76. package/dist/adapters/shared/index-environment-hashes.js +5 -13
  77. package/dist/adapters/{node-test → shared}/list-flag-values.d.ts +2 -1
  78. package/dist/adapters/shared/list-flag-values.js +10 -0
  79. package/dist/adapters/shared/list-tsconfig-files.d.ts +14 -5
  80. package/dist/adapters/shared/list-tsconfig-files.js +15 -13
  81. package/dist/adapters/shared/parse-tsconfig.d.ts +10 -0
  82. package/dist/adapters/shared/parse-tsconfig.js +19 -0
  83. package/dist/adapters/shared/read-flag-name.d.ts +9 -0
  84. package/dist/adapters/shared/read-flag-name.js +5 -0
  85. package/dist/adapters/shared/read-node-options.d.ts +11 -0
  86. package/dist/adapters/shared/read-node-options.js +6 -0
  87. package/dist/adapters/shared/read-prefork-switch.d.ts +10 -0
  88. package/dist/adapters/shared/read-prefork-switch.js +5 -0
  89. package/dist/adapters/shared/read-tsconfig-extends.d.ts +2 -5
  90. package/dist/adapters/shared/read-tsconfig-extends.js +16 -31
  91. package/dist/adapters/shared/read-tsconfig-references.d.ts +12 -0
  92. package/dist/adapters/shared/read-tsconfig-references.js +13 -0
  93. package/dist/adapters/shared/track-file-inputs.d.ts +7 -3
  94. package/dist/adapters/shared/track-file-inputs.js +16 -7
  95. package/dist/adapters/shared/track-file-reads.d.ts +13 -8
  96. package/dist/adapters/shared/track-file-reads.js +122 -69
  97. package/dist/adapters/shared/track-inputs.d.ts +13 -6
  98. package/dist/adapters/shared/track-inputs.js +7 -7
  99. package/dist/adapters/shared/track-process-group.d.ts +2 -1
  100. package/dist/adapters/shared/track-process-group.js +7 -2
  101. package/dist/adapters/shared/types/file-input-tracking.d.ts +6 -0
  102. package/dist/adapters/shared/types/input-tracking.d.ts +3 -3
  103. package/dist/adapters/vitest/build-isolated-facts.d.ts +4 -3
  104. package/dist/adapters/vitest/collect-dependencies.d.ts +10 -3
  105. package/dist/adapters/vitest/collect-dependencies.js +36 -26
  106. package/dist/adapters/vitest/configure-project.d.ts +3 -2
  107. package/dist/adapters/vitest/configure-project.js +1 -1
  108. package/dist/adapters/vitest/create-forks-pool.d.ts +34 -7
  109. package/dist/adapters/vitest/create-forks-pool.js +102 -24
  110. package/dist/adapters/vitest/create-interleaved-sequencer.d.ts +3 -2
  111. package/dist/adapters/vitest/drop-signal-listeners.d.ts +14 -0
  112. package/dist/adapters/vitest/drop-signal-listeners.js +15 -0
  113. package/dist/adapters/vitest/get-cache-inputs.d.ts +3 -1
  114. package/dist/adapters/vitest/get-cache-inputs.js +46 -29
  115. package/dist/adapters/vitest/get-module-file.d.ts +3 -5
  116. package/dist/adapters/vitest/get-module-file.js +1 -1
  117. package/dist/adapters/vitest/get-spare-key.d.ts +15 -0
  118. package/dist/adapters/vitest/get-spare-key.js +15 -0
  119. package/dist/adapters/vitest/index.d.ts +2 -1
  120. package/dist/adapters/vitest/index.js +1 -0
  121. package/dist/adapters/vitest/is-virtual-module.d.ts +10 -0
  122. package/dist/adapters/vitest/is-virtual-module.js +8 -0
  123. package/dist/adapters/vitest/list-script-defines.d.ts +13 -0
  124. package/dist/adapters/vitest/list-script-defines.js +22 -0
  125. package/dist/adapters/vitest/read-out-files.d.ts +7 -2
  126. package/dist/adapters/vitest/read-out-files.js +5 -5
  127. package/dist/adapters/vitest/read-out-records.d.ts +17 -0
  128. package/dist/adapters/vitest/read-out-records.js +27 -0
  129. package/dist/adapters/vitest/read-strays.d.ts +20 -0
  130. package/dist/adapters/vitest/read-strays.js +53 -0
  131. package/dist/adapters/vitest/read-unit-inputs.d.ts +9 -2
  132. package/dist/adapters/vitest/read-unit-inputs.js +1 -1
  133. package/dist/adapters/vitest/run-dry.js +17 -17
  134. package/dist/adapters/vitest/run-plan.d.ts +10 -6
  135. package/dist/adapters/vitest/run-plan.js +16 -16
  136. package/dist/adapters/vitest/run-specifications.d.ts +11 -3
  137. package/dist/adapters/vitest/run-specifications.js +22 -12
  138. package/dist/adapters/vitest/runner.d.ts +92 -46
  139. package/dist/adapters/vitest/runner.js +126 -104
  140. package/dist/adapters/vitest/start-vitest-session.d.ts +5 -1
  141. package/dist/adapters/vitest/start-vitest-session.js +64 -59
  142. package/dist/adapters/vitest/stop-hung-worker.d.ts +11 -4
  143. package/dist/adapters/vitest/stop-hung-worker.js +20 -7
  144. package/dist/adapters/vitest/types/mootant-forks-pool.d.ts +47 -0
  145. package/dist/adapters/vitest/types/stray-decisions.d.ts +8 -0
  146. package/dist/adapters/vitest/types/unit-outcome.d.ts +2 -1
  147. package/dist/adapters/vitest/types/vitest-session-state.d.ts +9 -8
  148. package/dist/adapters/vitest/types/vitest-worker.d.ts +118 -32
  149. package/dist/adapters/vitest/wait-for-workers.d.ts +5 -2
  150. package/dist/adapters/vitest/wait-for-workers.js +15 -15
  151. package/dist/adapters/vitest/worker/encode-stray.d.ts +16 -0
  152. package/dist/adapters/vitest/worker/encode-stray.js +16 -0
  153. package/dist/adapters/vitest/worker/intercept-strays.d.ts +26 -0
  154. package/dist/adapters/vitest/worker/intercept-strays.js +13 -0
  155. package/dist/adapters/vitest/worker/read-try-facts.d.ts +5 -4
  156. package/dist/adapters/vitest/worker/track-meta-defines.d.ts +39 -0
  157. package/dist/adapters/vitest/worker/track-meta-defines.js +23 -0
  158. package/dist/adapters/vitest/worker/track-values.d.ts +38 -0
  159. package/dist/adapters/vitest/worker/track-values.js +45 -0
  160. package/dist/adapters/vitest/worker/value-prefixes.d.ts +12 -0
  161. package/dist/adapters/vitest/worker/value-prefixes.js +6 -0
  162. package/dist/adapters/vitest/worker/wait-for-turn.d.ts +8 -6
  163. package/dist/adapters/vitest/worker/watch-property.d.ts +17 -0
  164. package/dist/adapters/vitest/worker/watch-property.js +27 -0
  165. package/dist/adapters/vitest/worker/write-out-record.d.ts +2 -2
  166. package/dist/cli/create-run-progress.d.ts +8 -1
  167. package/dist/cli/create-run-progress.js +4 -1
  168. package/dist/cli/ensure-exit.d.ts +11 -0
  169. package/dist/cli/ensure-exit.js +15 -0
  170. package/dist/cli/html/build-html-report.js +2 -1
  171. package/dist/cli/html/client/main.js +1 -1
  172. package/dist/cli/html/client/render-change.d.ts +3 -2
  173. package/dist/cli/html/client/render-code.d.ts +1 -1
  174. package/dist/cli/html/client/render-overview.d.ts +3 -3
  175. package/dist/cli/html/pack-replacement.d.ts +1 -1
  176. package/dist/cli/index.d.ts +1 -0
  177. package/dist/cli/index.js +3 -2
  178. package/dist/cli/parse-arguments.d.ts +4 -0
  179. package/dist/cli/parse-arguments.js +4 -1
  180. package/dist/cli/report/build-list-report.js +1 -1
  181. package/dist/cli/report/build-run-report.js +2 -1
  182. package/dist/cli/report/format-command.d.ts +5 -0
  183. package/dist/cli/report/format-command.js +1 -1
  184. package/dist/cli/report/format-file-groups.d.ts +1 -1
  185. package/dist/cli/report/format-run-text-report.d.ts +5 -4
  186. package/dist/cli/report/format-run-text-report.js +10 -10
  187. package/dist/cli/report/slim-run-report.d.ts +10 -10
  188. package/dist/cli/report/slim-run-report.js +1 -0
  189. package/dist/cli/run-mutation.d.ts +5 -1
  190. package/dist/cli/run-mutation.js +55 -47
  191. package/dist/cli/terminal/create-spinner.d.ts +2 -3
  192. package/dist/cli/terminal/create-spinner.js +23 -32
  193. package/dist/cli/terminal/get-text-style.js +4 -4
  194. package/dist/cli/watch-interrupts.d.ts +41 -0
  195. package/dist/cli/watch-interrupts.js +32 -0
  196. package/dist/core/cache/apply-cached-units.d.ts +8 -7
  197. package/dist/core/cache/build-hash.d.ts +9 -0
  198. package/dist/core/cache/build-hash.js +2 -0
  199. package/dist/core/cache/cache-version.d.ts +4 -4
  200. package/dist/core/cache/check-dry-snapshot.d.ts +25 -0
  201. package/dist/core/cache/check-dry-snapshot.js +13 -0
  202. package/dist/core/cache/create-dry-reuse-miss.d.ts +12 -0
  203. package/dist/core/cache/create-dry-reuse-miss.js +7 -0
  204. package/dist/core/cache/create-dry-snapshot.d.ts +71 -0
  205. package/dist/core/cache/create-dry-snapshot.js +27 -0
  206. package/dist/core/cache/create-run-cache.d.ts +20 -2
  207. package/dist/core/cache/create-run-cache.js +31 -22
  208. package/dist/core/cache/create-snapshot-session.d.ts +12 -0
  209. package/dist/core/cache/create-snapshot-session.js +19 -0
  210. package/dist/core/cache/get-build-id.d.ts +11 -0
  211. package/dist/core/cache/get-build-id.js +7 -0
  212. package/dist/core/cache/get-cache-path.d.ts +1 -1
  213. package/dist/core/cache/get-cache-path.js +1 -1
  214. package/dist/core/cache/get-dry-snapshot-key.d.ts +47 -0
  215. package/dist/core/cache/get-dry-snapshot-key.js +43 -0
  216. package/dist/core/cache/get-dry-snapshot-path.d.ts +9 -0
  217. package/dist/core/cache/get-dry-snapshot-path.js +5 -0
  218. package/dist/core/cache/get-environment-key.d.ts +9 -4
  219. package/dist/core/cache/get-environment-key.js +5 -4
  220. package/dist/core/cache/get-test-file-keys.d.ts +2 -1
  221. package/dist/core/cache/get-test-file-keys.js +11 -10
  222. package/dist/core/cache/hash-files.d.ts +11 -6
  223. package/dist/core/cache/hash-files.js +22 -17
  224. package/dist/core/cache/hash-project-tree.d.ts +22 -0
  225. package/dist/core/cache/hash-project-tree.js +69 -0
  226. package/dist/core/cache/is-dry-reuse-miss.d.ts +8 -0
  227. package/dist/core/cache/is-dry-reuse-miss.js +4 -0
  228. package/dist/core/cache/list-file-hashes.d.ts +4 -0
  229. package/dist/core/cache/list-file-hashes.js +5 -2
  230. package/dist/core/cache/list-install-states.d.ts +12 -0
  231. package/dist/core/cache/list-install-states.js +19 -0
  232. package/dist/core/cache/list-variable-hashes.d.ts +15 -0
  233. package/dist/core/cache/list-variable-hashes.js +14 -0
  234. package/dist/core/cache/prepare-run-cache.d.ts +64 -16
  235. package/dist/core/cache/prepare-run-cache.js +109 -62
  236. package/dist/core/cache/read-dry-snapshot.d.ts +10 -0
  237. package/dist/core/cache/read-dry-snapshot.js +15 -0
  238. package/dist/core/cache/read-run-cache.js +6 -2
  239. package/dist/core/cache/save-dry-snapshot.d.ts +34 -0
  240. package/dist/core/cache/save-dry-snapshot.js +32 -0
  241. package/dist/core/cache/save-run-cache.d.ts +8 -7
  242. package/dist/core/cache/save-run-cache.js +2 -1
  243. package/dist/core/cache/unknown-hash.d.ts +7 -0
  244. package/dist/core/cache/unknown-hash.js +2 -0
  245. package/dist/core/cache/volatile-variables.d.ts +7 -0
  246. package/dist/core/cache/volatile-variables.js +11 -0
  247. package/dist/core/cache/write-run-cache.js +1 -1
  248. package/dist/core/config/load-typescript-config.d.ts +6 -1
  249. package/dist/core/config/load-typescript-config.js +26 -10
  250. package/dist/core/config/prepare-run.d.ts +7 -3
  251. package/dist/core/config/prepare-run.js +1 -0
  252. package/dist/core/config/resolve-run-settings.d.ts +3 -2
  253. package/dist/core/config/resolve-run-settings.js +1 -0
  254. package/dist/core/config/validate-config.js +3 -2
  255. package/dist/core/files/get-package-manifest.d.ts +12 -0
  256. package/dist/core/files/get-package-manifest.js +7 -0
  257. package/dist/core/files/select-changed-mutants.d.ts +11 -6
  258. package/dist/core/files/select-changed-mutants.js +38 -13
  259. package/dist/core/generate/apply-solitary-rule.d.ts +8 -5
  260. package/dist/core/generate/apply-solitary-rule.js +36 -29
  261. package/dist/core/generate/collect-candidates.d.ts +23 -5
  262. package/dist/core/generate/collect-candidates.js +202 -92
  263. package/dist/core/generate/compare-targets.d.ts +14 -0
  264. package/dist/core/generate/compare-targets.js +6 -0
  265. package/dist/core/generate/deduplicate-candidates.d.ts +6 -4
  266. package/dist/core/generate/deduplicate-candidates.js +11 -9
  267. package/dist/core/generate/find-list-removal.d.ts +20 -0
  268. package/dist/core/generate/find-list-removal.js +26 -0
  269. package/dist/core/generate/generate-file-mutants.js +49 -47
  270. package/dist/core/generate/get-mutant-site.d.ts +18 -0
  271. package/dist/core/generate/get-mutant-site.js +4 -0
  272. package/dist/core/generate/get-target.d.ts +14 -0
  273. package/dist/core/generate/get-target.js +4 -0
  274. package/dist/core/generate/pick-host.d.ts +10 -0
  275. package/dist/core/generate/pick-host.js +16 -0
  276. package/dist/core/generate/validate-replacement.d.ts +15 -4
  277. package/dist/core/generate/validate-replacement.js +28 -13
  278. package/dist/core/ignore/find-ignore-rule.d.ts +8 -7
  279. package/dist/core/index.d.ts +18 -0
  280. package/dist/core/instrument/find-attribute-values.d.ts +12 -0
  281. package/dist/core/instrument/find-attribute-values.js +13 -0
  282. package/dist/core/instrument/get-site-syntax.d.ts +14 -0
  283. package/dist/core/instrument/get-site-syntax.js +12 -0
  284. package/dist/core/instrument/group-mutant-ranges.d.ts +7 -3
  285. package/dist/core/instrument/group-mutant-ranges.js +25 -19
  286. package/dist/core/instrument/instrument-file.d.ts +5 -3
  287. package/dist/core/instrument/instrument-file.js +10 -9
  288. package/dist/core/instrument/instrumenter-version.d.ts +1 -1
  289. package/dist/core/instrument/render-branch.d.ts +17 -0
  290. package/dist/core/instrument/render-branch.js +81 -0
  291. package/dist/core/instrument/render-mutant-range.d.ts +17 -6
  292. package/dist/core/instrument/render-mutant-range.js +39 -13
  293. package/dist/core/list-mutants.d.ts +7 -5
  294. package/dist/core/list-mutants.js +2 -2
  295. package/dist/core/mutators/array-element.d.ts +7 -6
  296. package/dist/core/mutators/array-element.js +13 -13
  297. package/dist/core/mutators/assignment-operator.js +34 -33
  298. package/dist/core/mutators/boolean-literal.d.ts +3 -2
  299. package/dist/core/mutators/number-literal.d.ts +1 -1
  300. package/dist/core/mutators/object-property.d.ts +4 -3
  301. package/dist/core/mutators/object-property.js +7 -8
  302. package/dist/core/mutators/return-value.js +65 -33
  303. package/dist/core/mutators/shared/get-branch-copy-skip.d.ts +14 -9
  304. package/dist/core/mutators/shared/get-branch-copy-skip.js +34 -35
  305. package/dist/core/mutators/shared/get-canonical-falsy-default.d.ts +32 -0
  306. package/dist/core/mutators/shared/get-canonical-falsy-default.js +11 -0
  307. package/dist/core/mutators/shared/get-comparison-plan.d.ts +2 -2
  308. package/dist/core/mutators/shared/get-comparison-plan.js +86 -85
  309. package/dist/core/mutators/shared/get-condition-constants.d.ts +8 -8
  310. package/dist/core/mutators/shared/get-condition-constants.js +3 -3
  311. package/dist/core/mutators/shared/get-default-option-skip.d.ts +2 -2
  312. package/dist/core/mutators/shared/get-endless-value.d.ts +20 -0
  313. package/dist/core/mutators/shared/get-endless-value.js +25 -0
  314. package/dist/core/mutators/shared/get-forced-test-justifier.d.ts +44 -0
  315. package/dist/core/mutators/shared/get-forced-test-justifier.js +25 -0
  316. package/dist/core/mutators/shared/get-group-constant.d.ts +6 -6
  317. package/dist/core/mutators/shared/get-group-constant.js +2 -2
  318. package/dist/core/mutators/shared/get-literal-skip.d.ts +9 -9
  319. package/dist/core/mutators/shared/get-literal-skip.js +2 -2
  320. package/dist/core/mutators/shared/get-logical-drops.d.ts +8 -8
  321. package/dist/core/mutators/shared/get-logical-drops.js +80 -82
  322. package/dist/core/mutators/shared/get-loop-running-skip.d.ts +2 -2
  323. package/dist/core/mutators/shared/get-nullish-swap-skip.d.ts +2 -2
  324. package/dist/core/mutators/shared/get-or-default-skip.d.ts +2 -2
  325. package/dist/core/mutators/shared/get-owned-constants.d.ts +2 -2
  326. package/dist/core/mutators/shared/get-owner-constant.d.ts +3 -1
  327. package/dist/core/mutators/shared/get-running-value.d.ts +5 -4
  328. package/dist/core/mutators/shared/get-toward-mutant.d.ts +10 -2
  329. package/dist/core/mutators/shared/get-toward-mutant.js +45 -40
  330. package/dist/core/mutators/shared/has-other-exit.js +16 -36
  331. package/dist/core/mutators/shared/is-loop-exit.d.ts +20 -0
  332. package/dist/core/mutators/shared/is-loop-exit.js +32 -0
  333. package/dist/core/mutators/shared/is-read-only.d.ts +26 -0
  334. package/dist/core/mutators/shared/is-read-only.js +53 -0
  335. package/dist/core/mutators/shared/leave-now-skip.d.ts +2 -2
  336. package/dist/core/mutators/shared/no-op-callback-skip.d.ts +2 -2
  337. package/dist/core/mutators/statement-removal.d.ts +4 -3
  338. package/dist/core/mutators/statement-removal.js +69 -73
  339. package/dist/core/mutators/string-literal.d.ts +15 -5
  340. package/dist/core/mutators/string-literal.js +79 -50
  341. package/dist/core/plugins/create-mutator-registry.d.ts +4 -2
  342. package/dist/core/plugins/create-mutator-registry.js +15 -5
  343. package/dist/core/plugins/validate-plugin.d.ts +3 -3
  344. package/dist/core/plugins/validate-plugin.js +32 -10
  345. package/dist/core/presets/recommended.d.ts +2 -2
  346. package/dist/core/presets/strict.d.ts +4 -2
  347. package/dist/core/regex/collect-pattern-changes.d.ts +2 -2
  348. package/dist/core/regex/create-regex-replacement.d.ts +2 -2
  349. package/dist/core/run/apply-batch-result.d.ts +23 -22
  350. package/dist/core/run/apply-batch-result.js +5 -5
  351. package/dist/core/run/apply-isolated-result.d.ts +21 -12
  352. package/dist/core/run/apply-isolated-result.js +45 -25
  353. package/dist/core/run/classify-try.d.ts +9 -8
  354. package/dist/core/run/count-run.d.ts +2 -1
  355. package/dist/core/run/create-run-state.d.ts +5 -0
  356. package/dist/core/run/create-run-state.js +1 -0
  357. package/dist/core/run/create-work-directory.d.ts +4 -1
  358. package/dist/core/run/create-work-directory.js +15 -12
  359. package/dist/core/run/decide-evidence.d.ts +4 -3
  360. package/dist/core/run/get-test-file-limits.d.ts +13 -0
  361. package/dist/core/run/get-test-file-limits.js +13 -0
  362. package/dist/core/run/get-unit-evidence.d.ts +12 -3
  363. package/dist/core/run/get-unit-evidence.js +1 -1
  364. package/dist/core/run/guard-session.d.ts +18 -0
  365. package/dist/core/run/guard-session.js +30 -0
  366. package/dist/core/run/live-work-directories.d.ts +5 -0
  367. package/dist/core/run/live-work-directories.js +2 -0
  368. package/dist/core/run/plan-batch.d.ts +6 -3
  369. package/dist/core/run/plan-batch.js +36 -31
  370. package/dist/core/run/plan-isolated.d.ts +3 -1
  371. package/dist/core/run/plan-isolated.js +8 -14
  372. package/dist/core/run/read-isolated-unit.d.ts +9 -6
  373. package/dist/core/run/read-isolated-unit.js +77 -38
  374. package/dist/core/run/remove-live-work-directories.d.ts +7 -0
  375. package/dist/core/run/remove-live-work-directories.js +12 -0
  376. package/dist/core/run/run-batch-phases.d.ts +4 -3
  377. package/dist/core/run/run-dry-phase.d.ts +35 -19
  378. package/dist/core/run/run-dry-phase.js +127 -77
  379. package/dist/core/run/run-isolated-rounds.d.ts +15 -10
  380. package/dist/core/run/run-isolated-rounds.js +4 -2
  381. package/dist/core/run/validate-adapter.d.ts +1 -1
  382. package/dist/core/run/validate-adapter.js +1 -1
  383. package/dist/core/run-mutants.d.ts +59 -22
  384. package/dist/core/run-mutants.js +356 -208
  385. package/dist/core/runtime/create-hit-limit-error.d.ts +5 -3
  386. package/dist/core/runtime/create-hit-limit-error.js +1 -1
  387. package/dist/core/runtime/install-mutant-runtime.js +23 -6
  388. package/dist/core/runtime/runtime-version.d.ts +4 -4
  389. package/dist/core/skips/skip-rules.d.ts +7 -1
  390. package/dist/core/skips/skip-rules.js +4 -0
  391. package/dist/core/syntax/is-brace-sensitive-attribute.d.ts +18 -0
  392. package/dist/core/syntax/is-brace-sensitive-attribute.js +28 -0
  393. package/dist/core/syntax/is-spread-safe-member.d.ts +18 -0
  394. package/dist/core/syntax/is-spread-safe-member.js +18 -0
  395. package/dist/core/syntax/is-value-position.d.ts +3 -1
  396. package/dist/core/text/get-list-removal-range.d.ts +22 -0
  397. package/dist/core/text/get-list-removal-range.js +46 -0
  398. package/dist/core/text/is-plain-attribute-string.d.ts +10 -0
  399. package/dist/core/text/is-plain-attribute-string.js +5 -0
  400. package/dist/core/text/parse-expression.d.ts +8 -4
  401. package/dist/core/text/parse-expression.js +1 -0
  402. package/dist/core/text/remove-list-element.d.ts +2 -4
  403. package/dist/core/text/remove-list-element.js +4 -45
  404. package/dist/docs/styles/colors.js +1 -1
  405. package/dist/package.js +1 -1
  406. package/dist/types/adapter/adapter-context.d.ts +20 -0
  407. package/dist/types/adapter/adapter-session.d.ts +2 -1
  408. package/dist/types/adapter/cache-inputs.d.ts +3 -2
  409. package/dist/types/adapter/dry-file.d.ts +6 -3
  410. package/dist/types/adapter/dry-run-request.d.ts +5 -4
  411. package/dist/types/adapter/isolated-plan.d.ts +2 -1
  412. package/dist/types/adapter/isolated-result.d.ts +3 -1
  413. package/dist/types/adapter/mutant-runtime.d.ts +30 -1
  414. package/dist/types/adapter/run-inputs.d.ts +5 -4
  415. package/dist/types/adapter/test-adapter.d.ts +7 -0
  416. package/dist/types/cache/cache-entry.d.ts +9 -7
  417. package/dist/types/cache/cached-inputs.d.ts +2 -2
  418. package/dist/types/cache/dry-snapshot.d.ts +76 -0
  419. package/dist/types/cache/project-tree.d.ts +16 -0
  420. package/dist/types/cache/run-cache-file.d.ts +1 -1
  421. package/dist/types/cache/run-cache.d.ts +6 -5
  422. package/dist/types/cli/text-style.d.ts +1 -1
  423. package/dist/types/config/plugin.d.ts +11 -2
  424. package/dist/types/config/preset-settings.d.ts +2 -2
  425. package/dist/types/config/run-config.d.ts +22 -4
  426. package/dist/types/config/run-settings.d.ts +6 -0
  427. package/dist/types/html/indexed-mutant.d.ts +4 -2
  428. package/dist/types/html/shown-change.d.ts +4 -3
  429. package/dist/types/mutant/core-note.d.ts +12 -0
  430. package/dist/types/mutant/diagnostic.d.ts +1 -0
  431. package/dist/types/mutant/list-removal.d.ts +37 -0
  432. package/dist/types/mutant/mutant-candidate.d.ts +11 -17
  433. package/dist/types/mutant/mutant-host.d.ts +49 -0
  434. package/dist/types/mutant/mutant-kind.d.ts +18 -0
  435. package/dist/types/mutant/mutant-range.d.ts +15 -8
  436. package/dist/types/mutant/mutant.d.ts +9 -15
  437. package/dist/types/mutant/registered-skip-rule.d.ts +11 -0
  438. package/dist/types/mutant/site-syntax.d.ts +14 -0
  439. package/dist/types/mutant/skip-justifier.d.ts +3 -1
  440. package/dist/types/mutant/skip-note.d.ts +7 -6
  441. package/dist/types/mutant/skip-rule-id.d.ts +3 -2
  442. package/dist/types/mutant/skip-rule.d.ts +2 -1
  443. package/dist/types/mutant/skipped-candidate.d.ts +27 -17
  444. package/dist/types/mutant/skipped-mutant.d.ts +15 -12
  445. package/dist/types/mutator/mutator.d.ts +3 -2
  446. package/dist/types/mutator/registered-mutator.d.ts +8 -0
  447. package/dist/types/mutator/replacement.d.ts +14 -3
  448. package/dist/types/regex/regex-change.d.ts +2 -2
  449. package/dist/types/report/html-report.d.ts +13 -9
  450. package/dist/types/report/list-report-focus.d.ts +3 -2
  451. package/dist/types/report/list-report-justifier.d.ts +4 -2
  452. package/dist/types/report/list-report-mutant.d.ts +15 -9
  453. package/dist/types/report/list-report-skipped.d.ts +6 -4
  454. package/dist/types/report/list-report.d.ts +1 -1
  455. package/dist/types/report/run-report.d.ts +13 -4
  456. package/dist/types/report/slim-list-report.d.ts +6 -3
  457. package/dist/types/report/slim-run-report.d.ts +2 -2
  458. package/dist/types/run/isolated-evidence.d.ts +3 -2
  459. package/dist/types/run/isolated-reason.d.ts +6 -4
  460. package/dist/types/run/mutant-state.d.ts +1 -1
  461. package/dist/types/run/run-durations.d.ts +8 -3
  462. package/dist/types/run/run-event.d.ts +11 -8
  463. package/dist/types/run/run-kind.d.ts +3 -2
  464. package/dist/types/run/run-result.d.ts +17 -5
  465. package/dist/types/run/run-state.d.ts +30 -1
  466. package/dist/types/run/run-status.d.ts +2 -2
  467. package/dist/types/run/try-cause.d.ts +10 -7
  468. package/dist/types/syntax/syntax-helpers.d.ts +5 -3
  469. package/package.json +5 -5
  470. package/readme.md +85 -68
  471. package/skills/mootant/SKILL.md +50 -31
  472. package/skills/mootant/references/mutators.md +31 -23
  473. package/dist/adapters/node-test/list-flag-values.js +0 -9
  474. package/dist/core/instrument/get-site-check.d.ts +0 -9
  475. package/dist/core/instrument/get-site-check.js +0 -5
  476. package/dist/core/instrument/get-template-site-check.d.ts +0 -12
  477. package/dist/core/instrument/get-template-site-check.js +0 -5
  478. /package/dist/adapters/{node-test → shared}/loader-flags.d.ts +0 -0
  479. /package/dist/adapters/{node-test → shared}/loader-flags.js +0 -0
  480. /package/dist/cli/{built-in-adapters.d.ts → get-built-in-adapters.d.ts} +0 -0
  481. /package/dist/cli/{built-in-adapters.js → get-built-in-adapters.js} +0 -0
  482. /package/dist/cli/terminal/{colors.d.ts → create-colors.d.ts} +0 -0
  483. /package/dist/cli/terminal/{colors.js → create-colors.js} +0 -0
  484. /package/dist/{adapters/shared → core/files}/list-package-files.d.ts +0 -0
  485. /package/dist/{adapters/shared → core/files}/list-package-files.js +0 -0
  486. /package/dist/{adapters/shared → core/files}/read-package-type.d.ts +0 -0
  487. /package/dist/{adapters/shared → core/files}/read-package-type.js +0 -0
@@ -1,9 +1,11 @@
1
1
  /**
2
- * Creates the error that stops a try whose code evaluated more mutant sites
3
- * than its hit limit allows, such as a loop that a mutant made endless.
2
+ * Creates the error that stops a batch try, or a test file run with a mutant,
3
+ * whose code evaluated more mutant sites than allowed: a loop that a mutant
4
+ * made endless, or code that a mutant made far hotter, such as a cache turned
5
+ * off.
4
6
  *
5
7
  * @param id - Id of the mutant whose site went over the limit.
6
- * @param limit - Site evaluations the try was allowed.
8
+ * @param limit - Site evaluations allowed.
7
9
  * @returns Error named `MootantHitLimitError`.
8
10
  */
9
11
  export declare function createHitLimitError(id: string, limit: number): Error;
@@ -2,6 +2,6 @@ var e = class extends Error {
2
2
  name = "MootantHitLimitError";
3
3
  };
4
4
  function t(t, n) {
5
- return new e(`mootant stopped the test after ${n} evaluations of mutant sites, at mutant ${t}; the code is likely stuck in a loop.`);
5
+ return new e(`mootant stopped the test after ${n} evaluations of mutant sites, at mutant ${t}; the code may loop endlessly or do far more work than without mutants (see run.hitLimit).`);
6
6
  }
7
7
  export { t as createHitLimitError };
@@ -11,17 +11,34 @@ function r() {
11
11
  }), e;
12
12
  }
13
13
  function i() {
14
- let t = {
15
- hit(n) {
16
- if (t.hits += 1, t.hits > t.hitLimit) throw e(n, t.hitLimit);
17
- return t.coverage !== null && t.coverage.add(n), t.active === n && (t.reached = !0, !0);
14
+ let t = Symbol("mootant gap"), n = {
15
+ hit(t) {
16
+ if (n.hits += 1, n.hits > n.hitLimit) throw e(t, n.hitLimit);
17
+ return n.coverage !== null && n.coverage.add(t), n.active === t && (n.reached = !0, !0);
18
18
  },
19
+ hitAny(e) {
20
+ for (let t = 0; t < e.length; t++) if (n.hit(e[t])) return !0;
21
+ return !1;
22
+ },
23
+ cut(e) {
24
+ let n = 0;
25
+ for (let r = 0; r < e.length; r++) {
26
+ let i = e[r];
27
+ i !== t && (e[n] = i, n += 1);
28
+ }
29
+ return e.length = n, e;
30
+ },
31
+ none: { [Symbol.iterator]: () => ({ next: () => ({
32
+ value: void 0,
33
+ done: !0
34
+ }) }) },
19
35
  hitLimit: Infinity,
20
36
  coverage: null,
21
37
  reached: !1,
22
38
  active: null,
23
- hits: 0
39
+ hits: 0,
40
+ gap: t
24
41
  };
25
- return t;
42
+ return n;
26
43
  }
27
44
  export { r as installMutantRuntime };
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Version of the mutant runtime semantics: what `hit` counts and when it
3
- * reaches a mutant or stops at the hit limit. Part of the cache key; bump it
4
- * when they change.
2
+ * Version of the mutant runtime semantics: what `hit` and `hitAny` count, when
3
+ * they reach a mutant or stop at the hit limit, and how the helpers that remove
4
+ * an array element work. Part of the cache key; bump it when they change.
5
5
  */
6
- export declare const RUNTIME_VERSION = 1;
6
+ export declare const RUNTIME_VERSION = 2;
@@ -2,7 +2,9 @@
2
2
  * Registry of the rules that skip a candidate, keyed by rule id: the ownership
3
3
  * (O) and redundancy (R) labels of the catalog, and short kebab-case names for
4
4
  * the other rules. Each rule has one category and is a heuristic or not; a skip
5
- * names only its rule, so ids, categories and flags stay consistent.
5
+ * names only its rule, so ids, categories and flags stay consistent. Built-in
6
+ * mutators and the collection name these rules; a mutator of a plugin names
7
+ * them too, after the skip rules of its plugin.
6
8
  */
7
9
  export declare let skipRules: {
8
10
  'canonical-falsy-default': {
@@ -189,6 +191,10 @@ export declare let skipRules: {
189
191
  category: "equivalent";
190
192
  heuristic: true;
191
193
  };
194
+ 'literal-copies': {
195
+ category: "invalid";
196
+ heuristic: false;
197
+ };
192
198
  'shifted-literal': {
193
199
  category: "owned";
194
200
  heuristic: false;
@@ -183,6 +183,10 @@ let e = {
183
183
  category: "equivalent",
184
184
  heuristic: !0
185
185
  },
186
+ "literal-copies": {
187
+ category: "invalid",
188
+ heuristic: !1
189
+ },
186
190
  "shifted-literal": {
187
191
  category: "owned",
188
192
  heuristic: !1
@@ -0,0 +1,18 @@
1
+ import { JSXOpeningElement, JSXAttribute } from 'oxc-parser';
2
+ /**
3
+ * Tells whether a compiler may read the value of a JSX attribute another way
4
+ * once the mutant switch moves it into braces than while it is quoted. The
5
+ * compiler of Solid reads by its own rules, on any element, an attribute of its
6
+ * namespaces, such as `bool:`, of `solidNames`, such as `ref`, and one whose
7
+ * name starts with `on`, such as `onclick`. In braces it also sets a name of
8
+ * `propertyAttributes` on a built-in element and any attribute of a custom
9
+ * element, whose tag has a `-` or which has an `is` attribute, as a property,
10
+ * which can read the same text another way, as `disabled` reads `""` as false.
11
+ * Other props of a component stay the same either way; so do the attributes of
12
+ * other namespaces, such as `xlink:href`.
13
+ *
14
+ * @param attribute - Attribute with a quoted value.
15
+ * @param element - Opening element of the attribute.
16
+ * @returns Whether braces may change what the value does.
17
+ */
18
+ export declare function isBraceSensitiveAttribute(attribute: JSXAttribute, element: JSXOpeningElement): boolean;
@@ -0,0 +1,28 @@
1
+ let e = new Set((/* @__PURE__ */ "allowFullscreen.async.autofocus.autoplay.checked.controls.default.defaultChecked.defaultMuted.defaultSelected.defer.disabled.disablePictureInPicture.disableRemotePlayback.formNoValidate.hidden.indeterminate.inert.isMap.loop.multiple.muted.noModule.noValidate.open.playsInline.preservesPitch.readOnly.required.reversed.selected.shadowRootClonable.shadowRootDelegatesFocus.shadowRootSerializable.value".split(".")).map((e) => e.toLowerCase())), t = /* @__PURE__ */ new Set([
2
+ "oncapture",
3
+ "class",
4
+ "style",
5
+ "bool",
6
+ "prop",
7
+ "attr",
8
+ "use",
9
+ "on"
10
+ ]), n = /* @__PURE__ */ new Set([
11
+ "textContent",
12
+ "className",
13
+ "classList",
14
+ "innerHTML",
15
+ "innerText",
16
+ "children",
17
+ "class",
18
+ "style",
19
+ "ref"
20
+ ]);
21
+ const r = /^on/u, i = /^[a-z]/u;
22
+ function a(a, o) {
23
+ let { name: s } = a;
24
+ if (s.type === "JSXNamespacedName" ? t.has(s.namespace.name) : n.has(s.name) || r.test(s.name)) return !0;
25
+ let c = o.name;
26
+ return c.type !== "JSXIdentifier" || !i.test(c.name) ? !1 : c.name.includes("-") || o.attributes.some((e) => e.type === "JSXAttribute" && e.name.type === "JSXIdentifier" && e.name.name === "is") || s.type === "JSXIdentifier" && e.has(s.name.toLowerCase());
27
+ }
28
+ export { a as isBraceSensitiveAttribute };
@@ -0,0 +1,18 @@
1
+ import { ObjectPropertyKind } from 'oxc-parser';
2
+ /**
3
+ * Tells whether a member of an object literal behaves the same when it is
4
+ * spread from an object literal of its own, as the copy of a literal that the
5
+ * mutant switch runs while the removal of a member is active writes every
6
+ * member with a removal: `{ a, ...(removed ? {} : { b }), c }`. A spread, a
7
+ * data property and a method that cannot reach `super` do. An accessor does
8
+ * not, since a spread reads it and copies its value, nor does a method that
9
+ * uses `super` or calls `eval`, whose code may use it, since its home object
10
+ * would change. A member keyed `__proto__` in any form does not either: written
11
+ * plainly it sets the prototype, which a spread does not copy, and code that
12
+ * lowers spreads to assignments, such as `Object.assign`, turns the other forms
13
+ * into a prototype change too.
14
+ *
15
+ * @param member - Property or spread of an object literal.
16
+ * @returns Whether spreading the member keeps its meaning.
17
+ */
18
+ export declare function isSpreadSafeMember(member: ObjectPropertyKind): boolean;
@@ -0,0 +1,18 @@
1
+ import { unwrapExpression as e } from "../tree/unwrap-expression.js";
2
+ import { walkTree as t } from "../tree/walk-tree.js";
3
+ const n = "__proto__";
4
+ function r(e) {
5
+ return e.type === "SpreadElement" ? !0 : e.kind !== "init" || i(e) ? !1 : !e.method || !a(e.value);
6
+ }
7
+ function i(t) {
8
+ let r = e(t.key);
9
+ return r.type === "Identifier" ? !t.computed && r.name === n : r.type === "TemplateLiteral" ? r.expressions.length === 0 && r.quasis[0].value.cooked === n : r.type === "Literal" && r.value === n;
10
+ }
11
+ function a(n) {
12
+ let r = !1;
13
+ return t(n, (t) => {
14
+ let n = t.type === "CallExpression" ? e(t.callee) : null;
15
+ return r ||= t.type === "Super" || n?.type === "Identifier" && n.name === "eval", !r;
16
+ }), r;
17
+ }
18
+ export { r as isSpreadSafeMember };
@@ -8,7 +8,9 @@ import { TreeIndex } from '../../types/syntax/tree-index.js';
8
8
  * shorthand property values, method values, `delete` operands, `typeof`
9
9
  * identifiers, template parts of tagged templates, callee or tag expressions
10
10
  * that carry `this`, short-circuiting elements of optional chains, JSX
11
- * attribute values and JSX children are rejected.
11
+ * attribute values and JSX children are rejected. A quoted attribute value may
12
+ * still be replaced with a plain string, which the switch hosts in braces (see
13
+ * `validateReplacement`).
12
14
  *
13
15
  * @param tree - Runtime tree of the file.
14
16
  * @param node - Node of the runtime tree.
@@ -0,0 +1,22 @@
1
+ import { ListExpression } from '../../types/syntax/list-expression.js';
2
+ import { SourceRange } from '../../types/source/source-range.js';
3
+ import { ParsedFile } from '../../types/source/parsed-file.js';
4
+ /**
5
+ * Finds the text that removing one element of a list expression deletes: an
6
+ * array element, an object member or a call argument, with one comma next to
7
+ * it, so the list stays well formed. Removing the only element deletes
8
+ * everything between the delimiters, removing an element that is not the last
9
+ * deletes up to the start of the next one (its indentation is kept), and
10
+ * removing the last element deletes from the comma before it, or, when a comma
11
+ * follows it at once, from just after the comma before it through the one after
12
+ * it, which leaves the same text. The comma of a hole before the last element
13
+ * is kept. Removing either of two equal neighbors written alike leaves the same
14
+ * text.
15
+ *
16
+ * @param parsed - File the node belongs to.
17
+ * @param node - Array, object, call or `new` expression.
18
+ * @param index - Position of the element to remove; it must not be a hole.
19
+ * @returns Range of the deleted text.
20
+ * @throws RangeError - When no element exists at the index.
21
+ */
22
+ export declare function getListRemovalRange(parsed: ParsedFile, node: ListExpression, index: number): SourceRange;
@@ -0,0 +1,46 @@
1
+ import { findTokenStart as e } from "./find-token-start.js";
2
+ function t(t, a, o) {
3
+ let s = i(a), c = s[o];
4
+ if (!c) throw RangeError(`List element ${o} does not exist.`);
5
+ let l = n(t, a);
6
+ if (s.length === 1) return {
7
+ start: l.start + 1,
8
+ end: l.end
9
+ };
10
+ if (o < s.length - 1) return {
11
+ end: s[o + 1]?.start ?? r(t, s, l)[o + 1],
12
+ start: c.start
13
+ };
14
+ let u = s[o - 1], d = u ? e(t, u.end, l.end) : r(t, s, l)[o - 1];
15
+ return t.text[c.end] === "," ? {
16
+ end: c.end + 1,
17
+ start: d + 1
18
+ } : {
19
+ start: u ? d : d + 1,
20
+ end: c.end
21
+ };
22
+ }
23
+ function n(e, t) {
24
+ if (t.type === "ArrayExpression" || t.type === "ObjectExpression") return {
25
+ start: t.start,
26
+ end: t.end - 1
27
+ };
28
+ let n = (t.typeArguments ?? t.callee).end;
29
+ for (; e.text[n] !== "(";) n = e.commentEnds.get(n) ?? n + 1;
30
+ return {
31
+ end: t.end - 1,
32
+ start: n
33
+ };
34
+ }
35
+ function r(t, n, r) {
36
+ let i = [], a = r.start + 1;
37
+ for (let o of n) {
38
+ let n = o?.start ?? e(t, a, r.end);
39
+ i.push(n), a = e(t, o?.end ?? n, r.end) + 1;
40
+ }
41
+ return i;
42
+ }
43
+ function i(e) {
44
+ return e.type === "ArrayExpression" ? e.elements : e.type === "ObjectExpression" ? e.properties : e.arguments;
45
+ }
46
+ export { t as getListRemovalRange };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Tells whether a text is a string literal that means the same string as a
3
+ * quoted JSX attribute value and as JavaScript: one string in double or single
4
+ * quotes without a backslash, a control character or a character reference. The
5
+ * mutant switch can move such a value into braces as it is written.
6
+ *
7
+ * @param text - Text of a string literal or of a quoted attribute value.
8
+ * @returns Whether JSX and JavaScript read the text as the same string.
9
+ */
10
+ export declare function isPlainAttributeString(text: string): boolean;
@@ -0,0 +1,5 @@
1
+ const e = /^(?:"[^\p{Cc}"\\]*"|'[^\p{Cc}'\\]*')$/u, t = /&(?:#|\w+;)/u;
2
+ function n(n) {
3
+ return e.test(n) && !t.test(n);
4
+ }
5
+ export { n as isPlainAttributeString };
@@ -2,10 +2,14 @@ import { Node } from 'oxc-parser';
2
2
  /**
3
3
  * Parses the text of a single expression, such as the text of a replacement, in
4
4
  * parentheses. In a `method` context the text is the value that an async
5
- * generator method returns, so `await`, `yield`, `super` and `new.target` parse
6
- * as they do there; in a `script` context it is a statement of a sloppy script,
7
- * where `await` and `yield` are names. A text that closes the parentheses and
8
- * adds a statement or a member is not one expression.
5
+ * generator method of a module returns, so `await`, `yield`, `super`,
6
+ * `new.target` and `import.meta` parse as they do there. The source type is set
7
+ * to module rather than detected: oxc, which takes a text with `import.meta`
8
+ * for a module, reads a regular expression that starts with `<!--` right after
9
+ * a `(` of a detected module as an HTML comment. In a `script` context the text
10
+ * is a statement of a sloppy script, where `await` and `yield` are names. A
11
+ * text that closes the parentheses and adds a statement or a member is not one
12
+ * expression.
9
13
  *
10
14
  * @param text - Source text of the expression, without parentheses.
11
15
  * @param lang - Language of the expression.
@@ -11,6 +11,7 @@ function t(t, n, r = "method") {
11
11
  return a.expression;
12
12
  }
13
13
  let { program: i, errors: a } = e(`expression.${n}`, `class Expression { async *read() { return (${t}) } }`, {
14
+ sourceType: "module",
14
15
  preserveParens: !0,
15
16
  lang: n
16
17
  });
@@ -2,10 +2,8 @@ import { ListExpression } from '../../types/syntax/list-expression.js';
2
2
  import { ParsedFile } from '../../types/source/parsed-file.js';
3
3
  /**
4
4
  * Builds the text of a list expression with one element removed: an array
5
- * element, an object member or a call argument. Removing the only element
6
- * empties the delimiters, removing an element that is not the last deletes up
7
- * to the start of the next one (its indentation is kept), and removing the last
8
- * element deletes from the comma before it.
5
+ * element, an object member or a call argument, with the comma next to it (see
6
+ * `getListRemovalRange`).
9
7
  *
10
8
  * @param parsed - File the node belongs to.
11
9
  * @param node - Array, object, call or `new` expression.
@@ -1,47 +1,6 @@
1
- import { findTokenStart as e } from "./find-token-start.js";
2
- function t(t, a, o) {
3
- let s = i(a), c = s[o];
4
- if (!c) throw RangeError(`List element ${o} does not exist.`);
5
- let l = n(t, a), u = r(t, s, l), d;
6
- if (s.length === 1) d = {
7
- start: l.start + 1,
8
- end: l.end
9
- };
10
- else if (o < s.length - 1) d = {
11
- end: u[o + 1],
12
- start: c.start
13
- };
14
- else {
15
- let n = s[o - 1];
16
- d = {
17
- start: n ? e(t, n.end, l.end) : u[o - 1] + 1,
18
- end: c.end
19
- };
20
- }
21
- let { text: f } = t;
22
- return f.slice(a.start, d.start) + f.slice(d.end, a.end);
23
- }
24
- function n(e, t) {
25
- if (t.type === "ArrayExpression" || t.type === "ObjectExpression") return {
26
- start: t.start,
27
- end: t.end - 1
28
- };
29
- let n = (t.typeArguments ?? t.callee).end;
30
- for (; e.text[n] !== "(";) n = e.commentEnds.get(n) ?? n + 1;
31
- return {
32
- end: t.end - 1,
33
- start: n
34
- };
35
- }
36
- function r(t, n, r) {
37
- let i = [], a = r.start + 1;
38
- for (let o of n) {
39
- let n = o?.start ?? e(t, a, r.end);
40
- i.push(n), a = e(t, o?.end ?? n, r.end) + 1;
41
- }
42
- return i;
43
- }
44
- function i(e) {
45
- return e.type === "ArrayExpression" ? e.elements : e.type === "ObjectExpression" ? e.properties : e.arguments;
1
+ import { getListRemovalRange as e } from "./get-list-removal-range.js";
2
+ function t(t, n, r) {
3
+ let i = e(t, n, r), { text: a } = t;
4
+ return a.slice(n.start, i.start) + a.slice(i.end, n.end);
46
5
  }
47
6
  export { t as removeListElement };
@@ -1,2 +1,2 @@
1
- var e = ":root {\n color-scheme: light;\n --color-background-brand: oklch(88.71% 0.2145 125.57deg);\n --color-background-brand-hover: oklch(83.71% 0.2145 125.57deg);\n --color-background-primary: oklch(96% 0.0083 91.48deg);\n --color-background-primary-hover: oklch(91% 0.0083 91.48deg);\n --color-background-secondary: oklch(98.5% 0.0083 91.48deg);\n --color-background-secondary-hover: oklch(93.5% 0.0083 91.48deg);\n --color-background-tertiary: oklch(91.5% 0.0083 91.48deg);\n --color-background-selection: oklch(88.71% 0.2145 125.57deg / 88%);\n --color-content-brand: oklch(61.01% 0.147 125.57deg);\n --color-content-brand-hover: oklch(56.01% 0.147 125.57deg);\n --color-content-primary: oklch(20.5% 0.0081 274.52deg);\n --color-content-secondary: oklch(48.5% 0.0081 274.52deg);\n --color-content-selection: oklch(20.53% 0.0081 274.52deg);\n --color-border-brand: oklch(88.71% 0.2145 125.57deg);\n --color-border-primary: oklch(87.93% 0.0113 89.73deg);\n --color-border-secondary: oklch(20.5% 0.0081 274.52deg);\n --color-overlay-brand: oklch(90% 0.2145 125.57deg / 30%);\n --color-overlay-primary: oklch(20.5% 0.0081 274.52deg / 25%);\n\n /* Code editor */\n --color-code-foreground: oklch(29% 0.011 265deg);\n --color-code-background: oklch(98.5% 0.006 95deg);\n --color-code-ansi-black: oklch(29% 0.011 265deg);\n --color-code-ansi-red: oklch(48% 0.14 25deg);\n --color-code-ansi-green: oklch(61.01% 0.147 125.57deg);\n --color-code-ansi-yellow: oklch(49% 0.09 80deg);\n --color-code-ansi-blue: oklch(47% 0.14 255deg);\n --color-code-ansi-magenta: oklch(50% 0.11 325deg);\n --color-code-ansi-cyan: oklch(49% 0.075 196deg);\n --color-code-ansi-white: oklch(51% 0.008 95deg);\n --color-code-ansi-bright-black: oklch(52% 0.012 265deg);\n --color-code-ansi-bright-red: var(--color-code-ansi-red);\n --color-code-ansi-bright-green: var(--color-code-ansi-green);\n --color-code-ansi-bright-yellow: var(--color-code-ansi-yellow);\n --color-code-ansi-bright-blue: var(--color-code-ansi-blue);\n --color-code-ansi-bright-magenta: var(--color-code-ansi-magenta);\n --color-code-ansi-bright-cyan: var(--color-code-ansi-cyan);\n --color-code-ansi-bright-white: oklch(55% 0.008 95deg);\n --color-code-line-removed: color-mix(\n in oklch,\n var(--color-code-ansi-red) 10%,\n transparent\n );\n --color-code-line-added: color-mix(\n in oklch,\n var(--color-code-ansi-green) 10%,\n transparent\n );\n --color-code-token-keyword: var(--color-content-secondary);\n --color-code-token-comment: var(--color-code-ansi-bright-black);\n\n &[data-theme='dark'] {\n color-scheme: dark;\n --color-background-brand: oklch(88.71% 0.2145 125.57deg);\n --color-background-brand-hover: oklch(93.71% 0.2145 125.57deg);\n --color-background-primary: oklch(20.5% 0.0081 274.52deg);\n --color-background-primary-hover: oklch(25.5% 0.0081 274.52deg);\n --color-background-secondary: oklch(23.5% 0.0081 274.52deg);\n --color-background-secondary-hover: oklch(28.5% 0.0081 274.52deg);\n --color-background-tertiary: oklch(17.5% 0.0081 274.52deg);\n --color-background-selection: oklch(88.71% 0.2145 125.57deg / 88%);\n --color-content-brand: oklch(88.71% 0.2145 125.57deg);\n --color-content-brand-hover: oklch(93.71% 0.2145 125.57deg);\n --color-content-primary: oklch(96% 0.0083 91.48deg);\n --color-content-secondary: oklch(76% 0.0083 91.48deg);\n --color-content-selection: oklch(20.53% 0.0081 274.52deg);\n --color-border-brand: oklch(88.71% 0.2145 125.57deg);\n --color-border-primary: oklch(29.01% 0.0092 276.8deg);\n --color-border-secondary: oklch(96% 0.0083 91.48deg);\n --color-overlay-brand: oklch(90% 0.2145 125.57deg / 30%);\n --color-overlay-primary: oklch(10% 0.0081 274.52deg / 60%);\n\n /* Code editor */\n --color-code-foreground: oklch(96% 0.0083 91.48deg);\n --color-code-background: oklch(17.5% 0.0051 274.52deg);\n --color-code-ansi-black: oklch(37% 0.01 265deg);\n --color-code-ansi-red: oklch(77% 0.125 25deg);\n --color-code-ansi-green: oklch(88.71% 0.2145 125.57deg);\n --color-code-ansi-yellow: oklch(82% 0.105 83deg);\n --color-code-ansi-blue: oklch(79% 0.095 255deg);\n --color-code-ansi-magenta: oklch(78% 0.105 330deg);\n --color-code-ansi-cyan: oklch(80% 0.095 197deg);\n --color-code-ansi-white: oklch(89% 0.008 265deg);\n --color-code-ansi-bright-black: oklch(62% 0.0083 91.48deg);\n --color-code-ansi-bright-white: oklch(98.5% 0.0083 91.48deg);\n --color-code-line-removed: color-mix(\n in oklch,\n var(--color-code-ansi-red) 16%,\n transparent\n );\n --color-code-line-added: color-mix(\n in oklch,\n var(--color-code-ansi-green) 16%,\n transparent\n );\n }\n}\n";
1
+ var e = ":root {\n color-scheme: light;\n --color-background-brand: oklch(88.71% 0.2145 125.57deg);\n --color-background-brand-hover: oklch(83.71% 0.2145 125.57deg);\n --color-background-primary: oklch(96% 0.0083 91.48deg);\n --color-background-primary-hover: oklch(91% 0.0083 91.48deg);\n --color-background-secondary: oklch(98.5% 0.0083 91.48deg);\n --color-background-secondary-hover: oklch(93.5% 0.0083 91.48deg);\n --color-background-tertiary: oklch(91.5% 0.0083 91.48deg);\n --color-background-selection: oklch(88.71% 0.2145 125.57deg / 88%);\n --color-content-brand: oklch(61.01% 0.147 125.57deg);\n --color-content-brand-hover: oklch(56.01% 0.147 125.57deg);\n --color-content-primary: oklch(20.5% 0.0081 274.52deg);\n --color-content-secondary: oklch(48.5% 0.0081 274.52deg);\n --color-content-selection: oklch(20.53% 0.0081 274.52deg);\n --color-border-brand: oklch(88.71% 0.2145 125.57deg);\n --color-border-primary: oklch(87.93% 0.0113 89.73deg);\n --color-border-secondary: oklch(20.5% 0.0081 274.52deg);\n --color-overlay-brand: oklch(90% 0.2145 125.57deg / 30%);\n --color-overlay-primary: oklch(20.5% 0.0081 274.52deg / 25%);\n\n /* Code editor */\n --color-code-foreground: oklch(29% 0.011 265deg);\n --color-code-background: oklch(98.5% 0.006 95deg);\n --color-code-ansi-black: oklch(29% 0.011 265deg);\n --color-code-ansi-red: oklch(48% 0.14 25deg);\n --color-code-ansi-green: oklch(49.04% 0.1186 125.57deg);\n --color-code-ansi-yellow: oklch(49% 0.09 80deg);\n --color-code-ansi-blue: oklch(47% 0.14 255deg);\n --color-code-ansi-magenta: oklch(50% 0.11 325deg);\n --color-code-ansi-cyan: oklch(49% 0.075 196deg);\n --color-code-ansi-white: oklch(51% 0.008 95deg);\n --color-code-ansi-bright-black: oklch(52% 0.012 265deg);\n --color-code-ansi-bright-red: var(--color-code-ansi-red);\n --color-code-ansi-bright-green: var(--color-code-ansi-green);\n --color-code-ansi-bright-yellow: var(--color-code-ansi-yellow);\n --color-code-ansi-bright-blue: var(--color-code-ansi-blue);\n --color-code-ansi-bright-magenta: var(--color-code-ansi-magenta);\n --color-code-ansi-bright-cyan: var(--color-code-ansi-cyan);\n --color-code-ansi-bright-white: oklch(55% 0.008 95deg);\n --color-code-line-removed: color-mix(\n in oklch,\n var(--color-code-ansi-red) 10%,\n transparent\n );\n --color-code-line-added: color-mix(\n in oklch,\n var(--color-code-ansi-green) 10%,\n transparent\n );\n --color-code-token-keyword: var(--color-content-secondary);\n --color-code-token-comment: var(--color-code-ansi-bright-black);\n\n &[data-theme='dark'] {\n color-scheme: dark;\n --color-background-brand: oklch(88.71% 0.2145 125.57deg);\n --color-background-brand-hover: oklch(93.71% 0.2145 125.57deg);\n --color-background-primary: oklch(20.5% 0.0081 274.52deg);\n --color-background-primary-hover: oklch(25.5% 0.0081 274.52deg);\n --color-background-secondary: oklch(23.5% 0.0081 274.52deg);\n --color-background-secondary-hover: oklch(28.5% 0.0081 274.52deg);\n --color-background-tertiary: oklch(17.5% 0.0081 274.52deg);\n --color-background-selection: oklch(88.71% 0.2145 125.57deg / 88%);\n --color-content-brand: oklch(88.71% 0.2145 125.57deg);\n --color-content-brand-hover: oklch(93.71% 0.2145 125.57deg);\n --color-content-primary: oklch(96% 0.0083 91.48deg);\n --color-content-secondary: oklch(76% 0.0083 91.48deg);\n --color-content-selection: oklch(20.53% 0.0081 274.52deg);\n --color-border-brand: oklch(88.71% 0.2145 125.57deg);\n --color-border-primary: oklch(29.01% 0.0092 276.8deg);\n --color-border-secondary: oklch(96% 0.0083 91.48deg);\n --color-overlay-brand: oklch(90% 0.2145 125.57deg / 30%);\n --color-overlay-primary: oklch(10% 0.0081 274.52deg / 60%);\n\n /* Code editor */\n --color-code-foreground: oklch(96% 0.0083 91.48deg);\n --color-code-background: oklch(17.5% 0.0051 274.52deg);\n --color-code-ansi-black: oklch(37% 0.01 265deg);\n --color-code-ansi-red: oklch(77% 0.125 25deg);\n --color-code-ansi-green: oklch(88.71% 0.2145 125.57deg);\n --color-code-ansi-yellow: oklch(82% 0.105 83deg);\n --color-code-ansi-blue: oklch(79% 0.095 255deg);\n --color-code-ansi-magenta: oklch(78% 0.105 330deg);\n --color-code-ansi-cyan: oklch(80% 0.095 197deg);\n --color-code-ansi-white: oklch(89% 0.008 265deg);\n --color-code-ansi-bright-black: oklch(62% 0.0083 91.48deg);\n --color-code-ansi-bright-white: oklch(98.5% 0.0083 91.48deg);\n --color-code-line-removed: color-mix(\n in oklch,\n var(--color-code-ansi-red) 16%,\n transparent\n );\n --color-code-line-added: color-mix(\n in oklch,\n var(--color-code-ansi-green) 16%,\n transparent\n );\n }\n}\n";
2
2
  export { e as default };
package/dist/package.js CHANGED
@@ -1,2 +1,2 @@
1
- const e = "0.1.0";
1
+ const e = "0.3.0";
2
2
  export { e as version };
@@ -37,12 +37,32 @@ export interface AdapterContext {
37
37
  */
38
38
  concurrency: number | null
39
39
 
40
+ /**
41
+ * Whether isolated units of one test file may run at the same time, each in a
42
+ * worker of its own: the project's tests must not rely on a test file never
43
+ * running twice at once, as with a fixed file, port or database. False or
44
+ * omitted runs them one after another, in plan order. Only an adapter with
45
+ * `TestAdapter.parallelUnits` gets true.
46
+ */
47
+ parallelUnits?: boolean
48
+
40
49
  /**
41
50
  * Directory for files of this run (plans, results, heartbeats); the core
42
51
  * creates it and removes it after `close`.
43
52
  */
44
53
  workDirectory: string
45
54
 
55
+ /**
56
+ * Aborted once the run is interrupted, such as on a signal to the command
57
+ * line. From then on the adapter starts no test process and stops those that
58
+ * run, so the running call ends soon; the core waits for that call, drops
59
+ * what it gives, then calls `close` and calls nothing else. The command line
60
+ * gives this cleanup 5 seconds before it ends the process anyway, leaving
61
+ * what the adapter did not remove. Optional; an adapter that ignores it lets
62
+ * its running call go on until then.
63
+ */
64
+ signal?: AbortSignal
65
+
46
66
  /**
47
67
  * Project root: the directory of the mootant configuration, else the working
48
68
  * directory.
@@ -14,7 +14,8 @@ export interface AdapterSession {
14
14
  * Executes isolated units in one run. Several units may share a test file;
15
15
  * they run one after another, in plan order, never at the same time, since a
16
16
  * plain run of the test runner never runs a test file twice at once and tests
17
- * may rely on it (a fixed file, port or database).
17
+ * may rely on it (a fixed file, port or database), unless the context allows
18
+ * parallel units (`AdapterContext.parallelUnits`).
18
19
  */
19
20
  runIsolated(plan: IsolatedPlan): Promise<IsolatedResult>
20
21
 
@@ -7,8 +7,9 @@ export interface CacheInputs {
7
7
  * Hashes of the values of the environment variables test files see, by name,
8
8
  * for each project of the test runner by name (see `DryFile.project`), and
9
9
  * under `*` a hash of all of them but those that change from one shell to
10
- * another; a variable that is not set has no entry. Without it, variables
11
- * test files read count as not set.
10
+ * another; a variable that is not set has no entry. Other values have their
11
+ * hashes under the names `DryFile.environment` gives them. Without it,
12
+ * variables test files read count as not set.
12
13
  */
13
14
  environment?: Record<string, Record<string, string>>
14
15
 
@@ -8,14 +8,17 @@ export interface DryFile {
8
8
  * plugins watch for them, files the test code read, a missing one or a
9
9
  * directory included, and its snapshot files, whether they exist or not. Null
10
10
  * or omitted when the adapter cannot tell; the cache then never reuses or
11
- * stores verdicts of this test file.
11
+ * stores verdicts of this test file, and the dry phase ties its failures to
12
+ * switched files by mutant sites alone.
12
13
  */
13
14
  dependencies?: string[] | null
14
15
 
15
16
  /**
16
17
  * Names of the environment variables the test code read in the run, or `*`
17
- * when it listed them all; values come from `CacheInputs.environment`.
18
- * Omitted when the adapter does not track them.
18
+ * when it listed them all, and of other values of the test runner it read,
19
+ * under names no variable has, such as `provide=url` for Vitest's
20
+ * `inject('url')`; values come from `CacheInputs.environment`. Omitted when
21
+ * the adapter does not track them.
19
22
  */
20
23
  environment?: string[]
21
24
 
@@ -24,10 +24,11 @@ export interface DryRunRequest {
24
24
  instrumented: boolean
25
25
 
26
26
  /**
27
- * Absolute paths of mutated files, a hint of which test files to run when
28
- * `files` is null: those that may import them run. An adapter may run more,
29
- * such as every test file when it does not know yet what each one imports;
30
- * each test file it runs is reported as usual.
27
+ * Absolute paths of source files with mutants, a hint of which test files to
28
+ * run when `files` is null: those that may import them run. They include
29
+ * files the run does not switch, such as the files of mutants it does not
30
+ * run. An adapter may run more, such as every test file when it does not know
31
+ * yet what each one imports; each test file it runs is reported as usual.
31
32
  */
32
33
  related: string[]
33
34
 
@@ -32,7 +32,8 @@ export interface IsolatedUnit {
32
32
 
33
33
  /**
34
34
  * Units of one isolated run. Several units may share a test file; they never
35
- * run at the same time.
35
+ * run at the same time, unless the context allows parallel units
36
+ * (`AdapterContext.parallelUnits`).
36
37
  */
37
38
  export interface IsolatedPlan {
38
39
  /**
@@ -74,7 +74,9 @@ export interface IsolatedFacts {
74
74
 
75
75
  /**
76
76
  * What an isolated run reported; a unit without facts is planned once more,
77
- * then becomes `Error`.
77
+ * then becomes `Error`, and so is a unit in which something else stopped the
78
+ * tests that reach its mutant before they got to it, such as a failed suite
79
+ * hook.
78
80
  */
79
81
  export interface IsolatedResult {
80
82
  /**
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Switch and counters read through `globalThis.__mootant`. Adapters drive the
3
- * fields; switched code only calls `hit`.
3
+ * fields; switched code calls `hit` and `hitAny`, and the copy of a literal
4
+ * that removes an element uses `gap`, `none` and `cut`.
4
5
  */
5
6
  export interface MutantRuntime {
6
7
  /**
@@ -9,6 +10,21 @@ export interface MutantRuntime {
9
10
  */
10
11
  coverage: { add(id: string): unknown } | null
11
12
 
13
+ /**
14
+ * Calls `hit` for each id in order until one is active, as a chain of `hit`
15
+ * calls joined with `||` would, and tells whether one was.
16
+ *
17
+ * @throws Error - `MootantHitLimitError` as `hit` does.
18
+ */
19
+ hitAny(ids: readonly string[]): boolean
20
+
21
+ /**
22
+ * Drops every `gap` from an array literal that the switched code just built,
23
+ * in place, and returns it. It reads and writes only the own elements and the
24
+ * length of the array, so no code of the array or its prototypes runs.
25
+ */
26
+ cut<Value>(array: Value[]): Value[]
27
+
12
28
  /**
13
29
  * Counts one site evaluation, records the id when `coverage` is set, sets
14
30
  * `reached` when `id` is active, and tells whether it is.
@@ -18,6 +34,13 @@ export interface MutantRuntime {
18
34
  */
19
35
  hit(id: string): boolean
20
36
 
37
+ /**
38
+ * Iterable of no values, which the switched code spreads in place of a
39
+ * removed spread element; its iterator is its own, so no iterator of the
40
+ * array prototype runs.
41
+ */
42
+ none: Iterable<never>
43
+
21
44
  /**
22
45
  * Id of the active mutant, or null for the original code.
23
46
  */
@@ -37,4 +60,10 @@ export interface MutantRuntime {
37
60
  * Evaluations since the last reset.
38
61
  */
39
62
  hits: number
63
+
64
+ /**
65
+ * Value the switched code writes in place of a removed array element, which
66
+ * `cut` drops.
67
+ */
68
+ gap: symbol
40
69
  }
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * What a run of a test file read besides the code of its mutant: the files it
3
- * depended on and the environment variables it read. The cache compares them
4
- * with the dry run of the test file, and evidence that read more is reused only
5
- * while those extra inputs are unchanged.
3
+ * depended on and the environment variables and other values it read. The cache
4
+ * compares them with the dry run of the test file, and evidence that read more
5
+ * is reused only while those extra inputs are unchanged.
6
6
  */
7
7
  export interface RunInputs {
8
8
  /**
@@ -14,7 +14,8 @@ export interface RunInputs {
14
14
 
15
15
  /**
16
16
  * Names of the environment variables the test code read, or `*` when it
17
- * listed them all; values come from `CacheInputs.environment`.
17
+ * listed them all, and of other values, as in `DryFile.environment`; values
18
+ * come from `CacheInputs.environment`.
18
19
  */
19
20
  environment: string[]
20
21
  }
@@ -15,6 +15,13 @@ export interface TestAdapter {
15
15
  */
16
16
  start(context: AdapterContext): Promise<AdapterSession>
17
17
 
18
+ /**
19
+ * Whether the adapter runs isolated units of one test file at the same time
20
+ * when the context allows it (`AdapterContext.parallelUnits`). Optional;
21
+ * without it the core never allows it, and a run that asks for it notes so.
22
+ */
23
+ parallelUnits?: boolean
24
+
18
25
  /**
19
26
  * Version of the adapter itself, part of the cache key; the version of the
20
27
  * test runner is `AdapterSession.version`. Optional.