mootant 0.1.0 → 0.2.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 (244) hide show
  1. package/dist/adapters/jest/build-dry-file.d.ts +12 -12
  2. package/dist/adapters/jest/collect-jest-dependencies.d.ts +8 -7
  3. package/dist/adapters/jest/runner.d.ts +1 -1
  4. package/dist/adapters/jest/runner.js +1 -1
  5. package/dist/adapters/jest/types/jest-record.d.ts +4 -4
  6. package/dist/adapters/jest/types/unit-worker.d.ts +16 -8
  7. package/dist/adapters/jest/types/worker-session.d.ts +6 -7
  8. package/dist/adapters/jest/worker/boot-worker.d.ts +4 -3
  9. package/dist/adapters/jest/worker/run-unit.d.ts +20 -18
  10. package/dist/adapters/jest/worker/vm-setup.js +1 -1
  11. package/dist/adapters/jest/worker/worker.js +1 -1
  12. package/dist/adapters/jest/write-worker-session.d.ts +1 -2
  13. package/dist/adapters/jest/write-worker-session.js +2 -2
  14. package/dist/adapters/node-test/collect-node-dependencies.d.ts +5 -5
  15. package/dist/adapters/node-test/preload/preload.js +4 -1
  16. package/dist/adapters/node-test/run-test-file.js +1 -0
  17. package/dist/adapters/node-test/types/node-test-record.d.ts +3 -3
  18. package/dist/adapters/node-test/types/node-test-unit.d.ts +6 -1
  19. package/dist/adapters/shared/create-input-filter.d.ts +26 -0
  20. package/dist/adapters/shared/create-input-filter.js +32 -0
  21. package/dist/adapters/shared/track-file-inputs.d.ts +7 -3
  22. package/dist/adapters/shared/track-file-inputs.js +16 -7
  23. package/dist/adapters/shared/track-file-reads.d.ts +12 -8
  24. package/dist/adapters/shared/track-file-reads.js +110 -57
  25. package/dist/adapters/shared/track-inputs.d.ts +13 -6
  26. package/dist/adapters/shared/track-inputs.js +7 -7
  27. package/dist/adapters/shared/types/file-input-tracking.d.ts +6 -0
  28. package/dist/adapters/shared/types/input-tracking.d.ts +3 -3
  29. package/dist/adapters/vitest/collect-dependencies.d.ts +4 -3
  30. package/dist/adapters/vitest/collect-dependencies.js +25 -24
  31. package/dist/adapters/vitest/get-cache-inputs.js +3 -1
  32. package/dist/adapters/vitest/is-virtual-module.d.ts +11 -0
  33. package/dist/adapters/vitest/is-virtual-module.js +8 -0
  34. package/dist/adapters/vitest/read-out-files.d.ts +7 -2
  35. package/dist/adapters/vitest/read-out-files.js +5 -5
  36. package/dist/adapters/vitest/read-out-records.d.ts +17 -0
  37. package/dist/adapters/vitest/read-out-records.js +27 -0
  38. package/dist/adapters/vitest/read-strays.d.ts +20 -0
  39. package/dist/adapters/vitest/read-strays.js +53 -0
  40. package/dist/adapters/vitest/read-unit-inputs.d.ts +7 -1
  41. package/dist/adapters/vitest/read-unit-inputs.js +1 -1
  42. package/dist/adapters/vitest/run-dry.js +16 -16
  43. package/dist/adapters/vitest/run-plan.d.ts +3 -1
  44. package/dist/adapters/vitest/run-plan.js +15 -15
  45. package/dist/adapters/vitest/run-specifications.d.ts +3 -2
  46. package/dist/adapters/vitest/runner.d.ts +38 -23
  47. package/dist/adapters/vitest/runner.js +84 -85
  48. package/dist/adapters/vitest/types/stray-decisions.d.ts +8 -0
  49. package/dist/adapters/vitest/types/unit-outcome.d.ts +2 -1
  50. package/dist/adapters/vitest/types/vitest-worker.d.ts +83 -12
  51. package/dist/adapters/vitest/worker/encode-stray.d.ts +16 -0
  52. package/dist/adapters/vitest/worker/encode-stray.js +16 -0
  53. package/dist/adapters/vitest/worker/intercept-strays.d.ts +26 -0
  54. package/dist/adapters/vitest/worker/intercept-strays.js +13 -0
  55. package/dist/adapters/vitest/worker/read-try-facts.d.ts +5 -4
  56. package/dist/adapters/vitest/worker/write-out-record.d.ts +2 -2
  57. package/dist/cli/html/build-html-report.js +1 -1
  58. package/dist/cli/html/client/main.js +1 -1
  59. package/dist/cli/html/client/render-change.d.ts +3 -2
  60. package/dist/cli/html/client/render-code.d.ts +1 -1
  61. package/dist/cli/html/pack-replacement.d.ts +1 -1
  62. package/dist/cli/parse-arguments.js +1 -1
  63. package/dist/cli/report/build-list-report.js +1 -1
  64. package/dist/cli/report/build-run-report.js +1 -1
  65. package/dist/cli/report/format-file-groups.d.ts +1 -1
  66. package/dist/cli/run-mutation.js +31 -31
  67. package/dist/cli/terminal/create-spinner.d.ts +1 -1
  68. package/dist/cli/terminal/get-text-style.js +4 -4
  69. package/dist/core/cache/get-environment-key.js +2 -2
  70. package/dist/core/cache/hash-files.d.ts +7 -3
  71. package/dist/core/cache/hash-files.js +16 -17
  72. package/dist/core/cache/prepare-run-cache.d.ts +29 -7
  73. package/dist/core/cache/prepare-run-cache.js +96 -62
  74. package/dist/core/cache/save-run-cache.d.ts +8 -7
  75. package/dist/core/cache/save-run-cache.js +2 -1
  76. package/dist/core/cache/unknown-hash.d.ts +7 -0
  77. package/dist/core/cache/unknown-hash.js +2 -0
  78. package/dist/core/files/select-changed-mutants.d.ts +11 -6
  79. package/dist/core/files/select-changed-mutants.js +38 -13
  80. package/dist/core/generate/apply-solitary-rule.d.ts +8 -5
  81. package/dist/core/generate/apply-solitary-rule.js +36 -29
  82. package/dist/core/generate/collect-candidates.d.ts +18 -4
  83. package/dist/core/generate/collect-candidates.js +168 -86
  84. package/dist/core/generate/compare-targets.d.ts +14 -0
  85. package/dist/core/generate/compare-targets.js +6 -0
  86. package/dist/core/generate/deduplicate-candidates.d.ts +6 -4
  87. package/dist/core/generate/deduplicate-candidates.js +11 -9
  88. package/dist/core/generate/find-list-removal.d.ts +20 -0
  89. package/dist/core/generate/find-list-removal.js +26 -0
  90. package/dist/core/generate/generate-file-mutants.js +47 -46
  91. package/dist/core/generate/get-mutant-site.d.ts +18 -0
  92. package/dist/core/generate/get-mutant-site.js +4 -0
  93. package/dist/core/generate/get-target.d.ts +14 -0
  94. package/dist/core/generate/get-target.js +4 -0
  95. package/dist/core/generate/pick-host.d.ts +10 -0
  96. package/dist/core/generate/pick-host.js +16 -0
  97. package/dist/core/generate/validate-replacement.d.ts +15 -4
  98. package/dist/core/generate/validate-replacement.js +28 -13
  99. package/dist/core/ignore/find-ignore-rule.d.ts +8 -7
  100. package/dist/core/instrument/find-attribute-values.d.ts +12 -0
  101. package/dist/core/instrument/find-attribute-values.js +13 -0
  102. package/dist/core/instrument/get-site-syntax.d.ts +14 -0
  103. package/dist/core/instrument/get-site-syntax.js +12 -0
  104. package/dist/core/instrument/group-mutant-ranges.d.ts +7 -3
  105. package/dist/core/instrument/group-mutant-ranges.js +25 -19
  106. package/dist/core/instrument/instrument-file.d.ts +5 -3
  107. package/dist/core/instrument/instrument-file.js +10 -9
  108. package/dist/core/instrument/instrumenter-version.d.ts +1 -1
  109. package/dist/core/instrument/render-branch.d.ts +17 -0
  110. package/dist/core/instrument/render-branch.js +81 -0
  111. package/dist/core/instrument/render-mutant-range.d.ts +17 -6
  112. package/dist/core/instrument/render-mutant-range.js +39 -13
  113. package/dist/core/list-mutants.d.ts +7 -5
  114. package/dist/core/list-mutants.js +2 -2
  115. package/dist/core/mutators/array-element.d.ts +7 -6
  116. package/dist/core/mutators/array-element.js +13 -13
  117. package/dist/core/mutators/assignment-operator.js +34 -33
  118. package/dist/core/mutators/boolean-literal.d.ts +3 -2
  119. package/dist/core/mutators/number-literal.d.ts +1 -1
  120. package/dist/core/mutators/object-property.d.ts +4 -3
  121. package/dist/core/mutators/object-property.js +7 -8
  122. package/dist/core/mutators/return-value.js +65 -33
  123. package/dist/core/mutators/shared/get-branch-copy-skip.d.ts +12 -7
  124. package/dist/core/mutators/shared/get-branch-copy-skip.js +34 -35
  125. package/dist/core/mutators/shared/get-canonical-falsy-default.d.ts +32 -0
  126. package/dist/core/mutators/shared/get-canonical-falsy-default.js +11 -0
  127. package/dist/core/mutators/shared/get-comparison-plan.js +86 -85
  128. package/dist/core/mutators/shared/get-condition-constants.d.ts +8 -8
  129. package/dist/core/mutators/shared/get-condition-constants.js +3 -3
  130. package/dist/core/mutators/shared/get-endless-value.d.ts +20 -0
  131. package/dist/core/mutators/shared/get-endless-value.js +25 -0
  132. package/dist/core/mutators/shared/get-forced-test-justifier.d.ts +44 -0
  133. package/dist/core/mutators/shared/get-forced-test-justifier.js +25 -0
  134. package/dist/core/mutators/shared/get-group-constant.d.ts +4 -4
  135. package/dist/core/mutators/shared/get-group-constant.js +2 -2
  136. package/dist/core/mutators/shared/get-literal-skip.d.ts +6 -6
  137. package/dist/core/mutators/shared/get-literal-skip.js +2 -2
  138. package/dist/core/mutators/shared/get-logical-drops.d.ts +8 -8
  139. package/dist/core/mutators/shared/get-logical-drops.js +80 -82
  140. package/dist/core/mutators/shared/get-owner-constant.d.ts +3 -1
  141. package/dist/core/mutators/shared/get-running-value.d.ts +5 -4
  142. package/dist/core/mutators/shared/get-toward-mutant.d.ts +10 -2
  143. package/dist/core/mutators/shared/get-toward-mutant.js +45 -40
  144. package/dist/core/mutators/shared/has-other-exit.js +16 -36
  145. package/dist/core/mutators/shared/is-loop-exit.d.ts +20 -0
  146. package/dist/core/mutators/shared/is-loop-exit.js +32 -0
  147. package/dist/core/mutators/shared/is-read-only.d.ts +26 -0
  148. package/dist/core/mutators/shared/is-read-only.js +53 -0
  149. package/dist/core/mutators/statement-removal.d.ts +4 -3
  150. package/dist/core/mutators/statement-removal.js +69 -73
  151. package/dist/core/mutators/string-literal.d.ts +15 -5
  152. package/dist/core/mutators/string-literal.js +79 -50
  153. package/dist/core/presets/recommended.d.ts +2 -2
  154. package/dist/core/presets/strict.d.ts +4 -2
  155. package/dist/core/run/apply-batch-result.d.ts +23 -22
  156. package/dist/core/run/apply-batch-result.js +5 -5
  157. package/dist/core/run/apply-isolated-result.d.ts +18 -17
  158. package/dist/core/run/apply-isolated-result.js +1 -0
  159. package/dist/core/run/classify-try.d.ts +9 -8
  160. package/dist/core/run/get-test-file-limits.d.ts +13 -0
  161. package/dist/core/run/get-test-file-limits.js +13 -0
  162. package/dist/core/run/get-unit-evidence.d.ts +6 -3
  163. package/dist/core/run/get-unit-evidence.js +1 -1
  164. package/dist/core/run/plan-batch.d.ts +6 -3
  165. package/dist/core/run/plan-batch.js +36 -31
  166. package/dist/core/run/plan-isolated.d.ts +3 -1
  167. package/dist/core/run/plan-isolated.js +8 -14
  168. package/dist/core/run/read-isolated-unit.d.ts +4 -4
  169. package/dist/core/run/run-batch-phases.d.ts +4 -3
  170. package/dist/core/run/run-dry-phase.d.ts +35 -19
  171. package/dist/core/run/run-dry-phase.js +127 -77
  172. package/dist/core/run/run-isolated-rounds.d.ts +6 -5
  173. package/dist/core/run/run-isolated-rounds.js +1 -0
  174. package/dist/core/run-mutants.d.ts +26 -21
  175. package/dist/core/run-mutants.js +72 -64
  176. package/dist/core/runtime/create-hit-limit-error.d.ts +5 -3
  177. package/dist/core/runtime/create-hit-limit-error.js +1 -1
  178. package/dist/core/runtime/install-mutant-runtime.js +23 -6
  179. package/dist/core/runtime/runtime-version.d.ts +4 -4
  180. package/dist/core/skips/skip-rules.d.ts +4 -0
  181. package/dist/core/skips/skip-rules.js +4 -0
  182. package/dist/core/syntax/is-brace-sensitive-attribute.d.ts +18 -0
  183. package/dist/core/syntax/is-brace-sensitive-attribute.js +28 -0
  184. package/dist/core/syntax/is-spread-safe-member.d.ts +18 -0
  185. package/dist/core/syntax/is-spread-safe-member.js +18 -0
  186. package/dist/core/syntax/is-value-position.d.ts +3 -1
  187. package/dist/core/text/get-list-removal-range.d.ts +22 -0
  188. package/dist/core/text/get-list-removal-range.js +46 -0
  189. package/dist/core/text/is-plain-attribute-string.d.ts +10 -0
  190. package/dist/core/text/is-plain-attribute-string.js +5 -0
  191. package/dist/core/text/parse-expression.d.ts +8 -4
  192. package/dist/core/text/parse-expression.js +1 -0
  193. package/dist/core/text/remove-list-element.d.ts +2 -4
  194. package/dist/core/text/remove-list-element.js +4 -45
  195. package/dist/docs/styles/colors.js +1 -1
  196. package/dist/package.js +1 -1
  197. package/dist/types/adapter/dry-file.d.ts +2 -1
  198. package/dist/types/adapter/dry-run-request.d.ts +5 -4
  199. package/dist/types/adapter/mutant-runtime.d.ts +30 -1
  200. package/dist/types/cli/text-style.d.ts +1 -1
  201. package/dist/types/config/preset-settings.d.ts +2 -2
  202. package/dist/types/config/run-config.d.ts +12 -4
  203. package/dist/types/html/indexed-mutant.d.ts +4 -2
  204. package/dist/types/html/shown-change.d.ts +4 -3
  205. package/dist/types/mutant/list-removal.d.ts +37 -0
  206. package/dist/types/mutant/mutant-candidate.d.ts +11 -17
  207. package/dist/types/mutant/mutant-host.d.ts +49 -0
  208. package/dist/types/mutant/mutant-kind.d.ts +18 -0
  209. package/dist/types/mutant/mutant-range.d.ts +15 -8
  210. package/dist/types/mutant/mutant.d.ts +9 -15
  211. package/dist/types/mutant/site-syntax.d.ts +14 -0
  212. package/dist/types/mutant/skip-justifier.d.ts +3 -1
  213. package/dist/types/mutant/skipped-candidate.d.ts +13 -10
  214. package/dist/types/mutant/skipped-mutant.d.ts +9 -6
  215. package/dist/types/mutator/replacement.d.ts +14 -3
  216. package/dist/types/report/html-report.d.ts +10 -7
  217. package/dist/types/report/list-report-focus.d.ts +3 -2
  218. package/dist/types/report/list-report-justifier.d.ts +4 -2
  219. package/dist/types/report/list-report-mutant.d.ts +15 -9
  220. package/dist/types/report/list-report-skipped.d.ts +3 -2
  221. package/dist/types/report/list-report.d.ts +1 -1
  222. package/dist/types/report/run-report.d.ts +2 -2
  223. package/dist/types/report/slim-list-report.d.ts +6 -3
  224. package/dist/types/report/slim-run-report.d.ts +1 -1
  225. package/dist/types/run/isolated-reason.d.ts +4 -3
  226. package/dist/types/run/mutant-state.d.ts +1 -1
  227. package/dist/types/run/run-event.d.ts +1 -1
  228. package/dist/types/run/run-kind.d.ts +3 -2
  229. package/dist/types/run/run-result.d.ts +6 -3
  230. package/dist/types/run/run-state.d.ts +9 -1
  231. package/dist/types/run/run-status.d.ts +2 -2
  232. package/dist/types/run/try-cause.d.ts +8 -6
  233. package/dist/types/syntax/syntax-helpers.d.ts +5 -3
  234. package/package.json +5 -5
  235. package/skills/mootant/SKILL.md +14 -12
  236. package/skills/mootant/references/mutators.md +3 -1
  237. package/dist/core/instrument/get-site-check.d.ts +0 -9
  238. package/dist/core/instrument/get-site-check.js +0 -5
  239. package/dist/core/instrument/get-template-site-check.d.ts +0 -12
  240. package/dist/core/instrument/get-template-site-check.js +0 -5
  241. /package/dist/cli/{built-in-adapters.d.ts → get-built-in-adapters.d.ts} +0 -0
  242. /package/dist/cli/{built-in-adapters.js → get-built-in-adapters.js} +0 -0
  243. /package/dist/cli/terminal/{colors.d.ts → create-colors.d.ts} +0 -0
  244. /package/dist/cli/terminal/{colors.js → create-colors.js} +0 -0
@@ -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.2.0";
2
2
  export { e as version };
@@ -8,7 +8,8 @@ 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
 
@@ -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
 
@@ -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,4 +1,4 @@
1
- import { ColorName, Color } from '../../cli/terminal/colors.js';
1
+ import { ColorName, Color } from '../../cli/terminal/create-colors.js';
2
2
  /**
3
3
  * How text reports look where they are printed.
4
4
  */
@@ -36,8 +36,8 @@ export interface PresetSettings {
36
36
  templates: boolean
37
37
 
38
38
  /**
39
- * Whether mutants that only a timeout can kill are emitted, such as a loop
40
- * test forced to `true`. False unless a preset turns it on.
39
+ * Whether mutants that may cause timeouts are emitted, such as a loop test
40
+ * forced to `true`. False unless a preset turns it on.
41
41
  */
42
42
  timeouts: boolean
43
43
  }
@@ -5,14 +5,22 @@ import { TestAdapter } from '../adapter/test-adapter.js';
5
5
  */
6
6
  export interface RunConfig {
7
7
  /**
8
- * Per-try timeout: `ceil(factor × dry duration) + constant` milliseconds.
9
- * Defaults: factor 3, constant 250.
8
+ * Timeout: `ceil(factor × dry duration) + constant` milliseconds for loading
9
+ * a test file and for each test, added up while a test file runs with a
10
+ * mutant, or per test in the batch runs of fast mode. A mutant over it runs
11
+ * again with twice the timeout of its whole test file and counts as a timeout
12
+ * only when that run times out too, even when it only slows tests that pass
13
+ * in a plain run. Defaults: factor 3, constant 250.
10
14
  */
11
15
  timeout?: { constant?: number; factor?: number }
12
16
 
13
17
  /**
14
- * Hit limit per try: `max(floor, factor × dry hits)`. Defaults: factor 100,
15
- * floor 100000.
18
+ * Hit limit: `max(floor, factor × dry hits)` for loading a test file and for
19
+ * each test, added up while a test file runs with a mutant, or per test in
20
+ * the batch runs of fast mode, which send a mutant over it to a run of its
21
+ * whole test file. A mutant over it runs its test file once more with doubled
22
+ * time and `factor × floor` more evaluations, and counts as a timeout only
23
+ * when that run times out too. Defaults: factor 100, floor 100000.
16
24
  */
17
25
  hitLimit?: { factor?: number; floor?: number }
18
26
 
@@ -14,7 +14,8 @@ export interface IndexedMutant extends HtmlReportMutant {
14
14
  endLine: number
15
15
 
16
16
  /**
17
- * 1-based UTF-16 column of the first replaced character.
17
+ * 1-based UTF-16 column of the first replaced character, or of the removed
18
+ * element for kinds `element` and `property`.
18
19
  */
19
20
  column: number
20
21
 
@@ -24,7 +25,8 @@ export interface IndexedMutant extends HtmlReportMutant {
24
25
  index: number
25
26
 
26
27
  /**
27
- * 1-based line of the first replaced character.
28
+ * 1-based line of the first replaced character, or of the removed element for
29
+ * kinds `element` and `property`.
28
30
  */
29
31
  line: number
30
32
  }
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * Change of a text as the page shows it: a range of the file, the whole text
3
- * written in its place and, when the mutator names one, the part of the range
4
- * the change amounts to.
3
+ * written in its place and, when there is one, the part of the range the change
4
+ * amounts to.
5
5
  */
6
6
  export interface ShownChange {
7
7
  /**
8
- * Part of the range the change amounts to, when a mutator names one.
8
+ * Part of the range the change amounts to, when the mutator names one or the
9
+ * change removes an array element or an object member with its comma.
9
10
  */
10
11
  focus?: { replacement: string; start: number; end: number }
11
12
 
@@ -0,0 +1,37 @@
1
+ import { ObjectExpression, ArrayExpression } from 'oxc-parser';
2
+ import { MutantKind } from './mutant-kind.js';
3
+ /**
4
+ * Removal of one element of an array literal or one member of an object
5
+ * literal, which a mutator asks for with an empty replacement text.
6
+ */
7
+ export interface ListRemoval {
8
+ /**
9
+ * Kind of the narrowed removal: `element` in an array, `property` in an
10
+ * object.
11
+ */
12
+ kind: Extract<MutantKind, 'property' | 'element'>
13
+
14
+ /**
15
+ * Literal the element or member is removed from.
16
+ */
17
+ list: ObjectExpression | ArrayExpression
18
+
19
+ /**
20
+ * Whether the removal is narrowed to the element and hosted with the other
21
+ * removals of its literal; false when it replaces the whole literal: for
22
+ * every element of an array with a hole, for a member that a spread would
23
+ * change, such as an accessor, and for every removal in a Svelte template.
24
+ */
25
+ narrow: boolean
26
+
27
+ /**
28
+ * Number of elements or members of the literal whose removal is not narrowed,
29
+ * each of which takes a copy of the whole literal.
30
+ */
31
+ copies: number
32
+
33
+ /**
34
+ * Position of the element or member in the literal.
35
+ */
36
+ index: number
37
+ }
@@ -1,12 +1,17 @@
1
1
  import { RegisteredMutator } from '../mutator/registered-mutator.js';
2
2
  import { SourceRange } from '../source/source-range.js';
3
- import { TextEdit } from '../source/text-edit.js';
4
3
  import { IgnoreRule } from './ignore-rule.js';
4
+ import { MutantHost } from './mutant-host.js';
5
5
  /**
6
6
  * Replacement accepted from a visitor, before ids, the solitary rule and
7
- * deduplication.
7
+ * deduplication, with how the mutant switch would host it (see `MutantHost`).
8
8
  */
9
- export interface MutantCandidate {
9
+ export type MutantCandidate = CandidateFields & MutantHost
10
+
11
+ /**
12
+ * Fields of every candidate, whatever its host.
13
+ */
14
+ interface CandidateFields {
10
15
  /**
11
16
  * Ranges of the nodes whose effect the mutant removes as a whole, or null
12
17
  * when the solitary rule does not apply.
@@ -23,39 +28,28 @@ export interface MutantCandidate {
23
28
  */
24
29
  registered: RegisteredMutator
25
30
 
26
- /**
27
- * How the mutant is switched on, derived from the replaced node.
28
- */
29
- kind: 'expression' | 'block'
30
-
31
31
  /**
32
32
  * Dotted names of the declarations around the replaced node.
33
33
  */
34
34
  scope: string | null
35
35
 
36
- /**
37
- * Edit inside the replaced range that the mutant amounts to, which reports
38
- * show in place of the whole range; absent when the mutator names none.
39
- */
40
- focus?: TextEdit
41
-
42
36
  /**
43
37
  * Position in the order in which visitors returned replacements.
44
38
  */
45
39
  emission: number
46
40
 
47
41
  /**
48
- * Start of the replaced node.
42
+ * Start of the replaced range.
49
43
  */
50
44
  start: number
51
45
 
52
46
  /**
53
- * Text written in place of the node.
47
+ * Text written in place of the range.
54
48
  */
55
49
  text: string
56
50
 
57
51
  /**
58
- * End of the replaced node.
52
+ * End of the replaced range.
59
53
  */
60
54
  end: number
61
55
  }
@@ -0,0 +1,49 @@
1
+ import { SourceRange } from '../source/source-range.js';
2
+ import { TextEdit } from '../source/text-edit.js';
3
+ /**
4
+ * How the mutant switch hosts a mutant, with what the host needs: a mutant that
5
+ * replaces a range is hosted around that range, and the removal of an array
6
+ * element or an object member is hosted with the other removals of its
7
+ * literal.
8
+ */
9
+ export type MutantHost = RemovalHost | RangeHost
10
+
11
+ /**
12
+ * Mutant hosted around the range it replaces.
13
+ */
14
+ interface RangeHost {
15
+ /**
16
+ * `expression` for a conditional expression around the replaced expression,
17
+ * `block` for an `if`/`else` around the replaced statement.
18
+ */
19
+ kind: 'expression' | 'block'
20
+
21
+ /**
22
+ * Edit inside the replaced range that the mutant amounts to, which reports
23
+ * show in place of the whole range; absent when the mutator names none.
24
+ */
25
+ focus?: TextEdit
26
+ }
27
+
28
+ /**
29
+ * Removal of an array element (`element`) or an object member (`property`),
30
+ * hosted at its literal: the switched file runs the literal as written unless
31
+ * one of its removals is active, and then a copy without that element.
32
+ */
33
+ interface RemovalHost {
34
+ /**
35
+ * `element` in an array literal, `property` in an object literal.
36
+ */
37
+ kind: 'property' | 'element'
38
+
39
+ /**
40
+ * Range of the literal the element or member is removed from.
41
+ */
42
+ list: SourceRange
43
+
44
+ /**
45
+ * The removed element or member, with an empty text; reports show it in place
46
+ * of the whole range.
47
+ */
48
+ focus: TextEdit
49
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * How the mutant switch hosts a mutant, and so how a mutant is applied to the
3
+ * file:
4
+ *
5
+ * - `expression`: a conditional expression around the replaced expression; the
6
+ * replacement is written inside parentheses, and in place of a quoted JSX
7
+ * attribute value inside braces around them, as in `type={("")}`.
8
+ * - `block`: an `if`/`else` around the replaced statement; the replacement is
9
+ * written inside braces.
10
+ * - `element`: the removal of an element of an array literal, hosted with the
11
+ * other removals of the literal: the switched file runs the literal as
12
+ * written unless one of them is active, and then a copy of it that leaves
13
+ * that element out. The replacement, an empty text, is written as is, which
14
+ * deletes the element with its comma.
15
+ * - `property`: the removal of a member of an object literal, hosted and written
16
+ * like `element`.
17
+ */
18
+ export type MutantKind = 'expression' | 'property' | 'element' | 'block'
@@ -1,14 +1,12 @@
1
+ import { MutantKind } from './mutant-kind.js';
1
2
  import { Mutant } from './mutant.js';
2
3
  /**
3
4
  * Mutants that replace the same range of a file, with the groups of the ranges
4
- * inside it. The switched file hosts each group once.
5
+ * inside it. The switched file hosts each group once. The range of a group of
6
+ * removals of array elements or object members is their literal, which they are
7
+ * hosted around together.
5
8
  */
6
9
  export interface MutantRange {
7
- /**
8
- * How the group is hosted: a conditional expression or an `if` statement.
9
- */
10
- kind: 'expression' | 'block'
11
-
12
10
  /**
13
11
  * Groups of the ranges inside this one, sorted by start.
14
12
  */
@@ -20,12 +18,21 @@ export interface MutantRange {
20
18
  mutants: Mutant[]
21
19
 
22
20
  /**
23
- * Offset of the first replaced code unit.
21
+ * How the group is hosted: a conditional expression, an `if` statement, or a
22
+ * conditional expression around an array or object literal with a copy of it
23
+ * for the removals of its elements or members.
24
+ */
25
+ kind: MutantKind
26
+
27
+ /**
28
+ * Offset of the first replaced code unit, or of the literal of an `element`
29
+ * or `property` group.
24
30
  */
25
31
  start: number
26
32
 
27
33
  /**
28
- * Offset just past the last replaced code unit.
34
+ * Offset just past the last replaced code unit, or past the literal of an
35
+ * `element` or `property` group.
29
36
  */
30
37
  end: number
31
38
  }
@@ -1,22 +1,22 @@
1
1
  import { IgnoreSource } from './ignore-source.js';
2
2
  import { MutantStatus } from './mutant-status.js';
3
- import { TextEdit } from '../source/text-edit.js';
3
+ import { MutantHost } from './mutant-host.js';
4
4
  /**
5
- * Change to the source code that tests are expected to detect.
5
+ * Change to the source code that tests are expected to detect, with how the
6
+ * mutant switch hosts it (see `MutantHost`).
6
7
  */
7
- export interface Mutant {
8
+ export type Mutant = MutantFields & MutantHost
9
+
10
+ /**
11
+ * Fields of every mutant, whatever its host.
12
+ */
13
+ interface MutantFields {
8
14
  /**
9
15
  * Ignore directive comment that excluded the mutant, or null while the mutant
10
16
  * is pending.
11
17
  */
12
18
  ignoredBy: IgnoreSource | null
13
19
 
14
- /**
15
- * How the mutant will be switched on: as a ternary around an expression, or
16
- * as an `if`/`else` around a statement.
17
- */
18
- kind: 'expression' | 'block'
19
-
20
20
  /**
21
21
  * Why the mutant is not tested: the reason of the ignore directive that
22
22
  * covers it. Null while the mutant is pending.
@@ -39,12 +39,6 @@ export interface Mutant {
39
39
  */
40
40
  replacement: string
41
41
 
42
- /**
43
- * Edit inside the replaced range that the mutant amounts to, which reports
44
- * show in place of the whole range; absent when the mutator names none.
45
- */
46
- focus?: TextEdit
47
-
48
42
  /**
49
43
  * Id of the mutator that produced the mutant: `name` or `plugin/name`.
50
44
  */
@@ -0,0 +1,14 @@
1
+ /**
2
+ * How switched code at one place of a file reaches the mutant runtime.
3
+ */
4
+ export interface SiteSyntax {
5
+ /**
6
+ * Writes the id of a mutant as a string literal that the place accepts.
7
+ */
8
+ quote(id: string): string
9
+
10
+ /**
11
+ * Expression that reads the runtime; undefined where none is installed.
12
+ */
13
+ runtime: string
14
+ }
@@ -15,7 +15,9 @@ export interface SkipJustifier {
15
15
  mutator: string
16
16
 
17
17
  /**
18
- * Offset of the node the justifying mutant replaces.
18
+ * Offset where the justifying mutant is placed: at its removed element for
19
+ * kinds `element` and `property`, and at the start of the range it replaces
20
+ * otherwise.
19
21
  */
20
22
  start: number
21
23
  }
@@ -2,16 +2,11 @@ import { RegisteredMutator } from '../mutator/registered-mutator.js';
2
2
  import { SkipJustifier } from './skip-justifier.js';
3
3
  import { TextEdit } from '../source/text-edit.js';
4
4
  import { SkipRuleId } from './skip-rule-id.js';
5
+ import { MutantKind } from './mutant-kind.js';
5
6
  /**
6
7
  * Replacement that was considered and not emitted, before it is sorted.
7
8
  */
8
9
  export interface SkippedCandidate {
9
- /**
10
- * How the mutant switch would host the replacement, derived from the replaced
11
- * node; null when it cannot host it.
12
- */
13
- kind: 'expression' | 'block' | null
14
-
15
10
  /**
16
11
  * Mutator that considered the replacement.
17
12
  */
@@ -22,6 +17,13 @@ export interface SkippedCandidate {
22
17
  */
23
18
  by: SkipJustifier | null
24
19
 
20
+ /**
21
+ * How the mutant switch would host the replacement, derived from the replaced
22
+ * node or from the literal of a removed element or member; null when it
23
+ * cannot host it.
24
+ */
25
+ kind: MutantKind | null
26
+
25
27
  /**
26
28
  * Whether the skip rests on a guess beyond its rule.
27
29
  */
@@ -29,7 +31,8 @@ export interface SkippedCandidate {
29
31
 
30
32
  /**
31
33
  * Edit inside the replaced range that the mutant amounts to, which reports
32
- * show in place of the whole range; absent when the mutator names none.
34
+ * show in place of the whole range; set when the mutator names one, and on
35
+ * every removal of kind `element` or `property`.
33
36
  */
34
37
  focus?: TextEdit
35
38
 
@@ -49,17 +52,17 @@ export interface SkippedCandidate {
49
52
  reason: string
50
53
 
51
54
  /**
52
- * Start of the replaced node.
55
+ * Start of the replaced range.
53
56
  */
54
57
  start: number
55
58
 
56
59
  /**
57
- * Text that would have been written in place of the node.
60
+ * Text that would have been written in place of the range.
58
61
  */
59
62
  text: string
60
63
 
61
64
  /**
62
- * End of the replaced node.
65
+ * End of the replaced range.
63
66
  */
64
67
  end: number
65
68
  }
@@ -2,21 +2,23 @@ import { SkipJustifier } from './skip-justifier.js';
2
2
  import { SkipCategory } from './skip-category.js';
3
3
  import { TextEdit } from '../source/text-edit.js';
4
4
  import { SkipRuleId } from './skip-rule-id.js';
5
+ import { MutantKind } from './mutant-kind.js';
5
6
  /**
6
7
  * Mutation that a mutator or the pipeline considered and did not emit. It has
7
8
  * no id and never runs.
8
9
  */
9
10
  export interface SkippedMutant {
10
11
  /**
11
- * How the mutant switch would host the replacement, derived from the replaced
12
- * node; null when it cannot host it.
12
+ * Mutant that justifies the skip, or null when no single mutant does.
13
13
  */
14
- kind: 'expression' | 'block' | null
14
+ by: SkipJustifier | null
15
15
 
16
16
  /**
17
- * Mutant that justifies the skip, or null when no single mutant does.
17
+ * How the mutant switch would host the replacement, derived from the replaced
18
+ * node or from the literal of a removed element or member; null when it
19
+ * cannot host it.
18
20
  */
19
- by: SkipJustifier | null
21
+ kind: MutantKind | null
20
22
 
21
23
  /**
22
24
  * Category of the skip rule.
@@ -35,7 +37,8 @@ export interface SkippedMutant {
35
37
 
36
38
  /**
37
39
  * Edit inside the replaced range that the mutant amounts to, which reports
38
- * show in place of the whole range; absent when the mutator names none.
40
+ * show in place of the whole range; set when the mutator names one, and on
41
+ * every removal of kind `element` or `property`.
39
42
  */
40
43
  focus?: TextEdit
41
44
 
@@ -16,7 +16,8 @@ export interface Replacement {
16
16
  /**
17
17
  * Edit inside the replaced node that the mutant amounts to, such as the
18
18
  * changed part of a regular expression pattern. Reports show it in place of
19
- * the whole node; the mutant still replaces the whole node.
19
+ * the whole node; the mutant still replaces the whole node. Mootant sets the
20
+ * focus of a removed element or member, whatever the mutator gives.
20
21
  */
21
22
  focus?: TextEdit
22
23
 
@@ -30,13 +31,23 @@ export interface Replacement {
30
31
  /**
31
32
  * Text written in place of the node, built from slices of the original
32
33
  * source. An expression must parse inside parentheses, a statement list
33
- * inside braces.
34
+ * inside braces. An empty text for an element of an array literal or a member
35
+ * of an object literal removes it with its comma.
34
36
  */
35
37
  text: string
36
38
 
37
39
  /**
38
40
  * Node whose whole range, from `node.start` to `node.end`, is replaced: an
39
- * expression in a value position or a statement of the runtime tree.
41
+ * expression in a value position or a statement of the runtime tree. A quoted
42
+ * JSX attribute value is replaced too when it and the text are string
43
+ * literals without a backslash, a control character or a character reference,
44
+ * and a compiler such as Solid's reads the attribute the same way in braces,
45
+ * where Mootant hosts it: not for `value`, a boolean attribute, a name that
46
+ * starts with `on`, `ref`, `children`, `class`, `className`, `classList`,
47
+ * `style`, `innerHTML`, `innerText`, `textContent`, or an attribute of a
48
+ * custom element or of Solid's namespaces, such as `bool:`. With an empty
49
+ * text, an element of an array literal or a member of an object literal is
50
+ * removed with its comma instead.
40
51
  */
41
52
  node: Node
42
53
  }