tstyche 7.2.5 → 8.0.0-beta.1

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 (393) hide show
  1. package/README.md +4 -0
  2. package/dist/api.d.ts +16 -761
  3. package/dist/api.js +16 -6204
  4. package/dist/bin.js +2 -3
  5. package/dist/checker/BaseCheckerAdapter.d.ts +15 -0
  6. package/dist/checker/BaseCheckerAdapter.js +32 -0
  7. package/dist/checker/CompatCheckerAdapter.d.ts +70 -0
  8. package/dist/checker/CompatCheckerAdapter.js +221 -0
  9. package/dist/checker/NativeCheckerAdapter.d.ts +70 -0
  10. package/dist/checker/NativeCheckerAdapter.js +200 -0
  11. package/dist/checker/index.d.ts +3 -0
  12. package/dist/checker/index.js +2 -0
  13. package/dist/checker/types.d.ts +9 -0
  14. package/dist/checker/types.js +1 -0
  15. package/dist/cli/Cli.d.ts +5 -0
  16. package/dist/cli/Cli.js +144 -0
  17. package/dist/cli/CliDIagnosticText.d.ts +3 -0
  18. package/dist/cli/CliDIagnosticText.js +9 -0
  19. package/dist/cli/index.d.ts +1 -0
  20. package/dist/cli/index.js +1 -0
  21. package/dist/collect/CollectDiagnosticText.d.ts +3 -0
  22. package/dist/collect/CollectDiagnosticText.js +5 -0
  23. package/dist/collect/CollectService.d.ts +9 -0
  24. package/dist/collect/CollectService.js +150 -0
  25. package/dist/collect/ExpectNode.d.ts +16 -0
  26. package/dist/collect/ExpectNode.js +30 -0
  27. package/dist/collect/IdentifierLookup.d.ts +18 -0
  28. package/dist/collect/IdentifierLookup.js +90 -0
  29. package/dist/collect/TestTree.d.ts +16 -0
  30. package/dist/collect/TestTree.js +15 -0
  31. package/dist/collect/TestTreeNode.d.ts +15 -0
  32. package/dist/collect/TestTreeNode.js +27 -0
  33. package/dist/collect/TestTreeNodeBrand.enum.d.ts +6 -0
  34. package/dist/collect/TestTreeNodeBrand.enum.js +7 -0
  35. package/dist/collect/TestTreeNodeFlags.enum.d.ts +6 -0
  36. package/dist/collect/TestTreeNodeFlags.enum.js +7 -0
  37. package/dist/collect/index.d.ts +6 -0
  38. package/dist/collect/index.js +6 -0
  39. package/dist/config/CommandParser.d.ts +7 -0
  40. package/dist/config/CommandParser.js +107 -0
  41. package/dist/config/Config.d.ts +18 -0
  42. package/dist/config/Config.js +59 -0
  43. package/dist/config/ConfigDiagnosticText.d.ts +19 -0
  44. package/dist/config/ConfigDiagnosticText.js +57 -0
  45. package/dist/config/ConfigParser.d.ts +10 -0
  46. package/dist/config/ConfigParser.js +165 -0
  47. package/dist/config/Directive.d.ts +9 -0
  48. package/dist/config/Directive.js +119 -0
  49. package/dist/config/DirectiveDiagnosticText.d.ts +5 -0
  50. package/dist/config/DirectiveDiagnosticText.js +11 -0
  51. package/dist/config/OptionBrand.enum.d.ts +8 -0
  52. package/dist/config/OptionBrand.enum.js +9 -0
  53. package/dist/config/OptionGroup.enum.d.ts +5 -0
  54. package/dist/config/OptionGroup.enum.js +6 -0
  55. package/dist/config/Options.d.ts +29 -0
  56. package/dist/config/Options.js +290 -0
  57. package/dist/config/Target.d.ts +7 -0
  58. package/dist/config/Target.js +47 -0
  59. package/dist/config/defaultOptions.d.ts +2 -0
  60. package/dist/config/defaultOptions.js +14 -0
  61. package/dist/config/index.d.ts +8 -0
  62. package/dist/config/index.js +7 -0
  63. package/dist/config/types.d.ts +55 -0
  64. package/dist/config/types.js +1 -0
  65. package/dist/diagnostic/Diagnostic.d.ts +19 -0
  66. package/dist/diagnostic/Diagnostic.js +51 -0
  67. package/dist/diagnostic/DiagnosticCategory.enum.d.ts +4 -0
  68. package/dist/diagnostic/DiagnosticCategory.enum.js +5 -0
  69. package/dist/diagnostic/DiagnosticOrigin.d.ts +13 -0
  70. package/dist/diagnostic/DiagnosticOrigin.js +27 -0
  71. package/dist/diagnostic/helpers.d.ts +6 -0
  72. package/dist/diagnostic/helpers.js +74 -0
  73. package/dist/diagnostic/index.d.ts +5 -0
  74. package/dist/diagnostic/index.js +4 -0
  75. package/dist/diagnostic/types.d.ts +2 -0
  76. package/dist/diagnostic/types.js +1 -0
  77. package/dist/editor/TextEditor.d.ts +15 -0
  78. package/dist/editor/TextEditor.js +88 -0
  79. package/dist/editor/index.d.ts +2 -0
  80. package/dist/editor/index.js +1 -0
  81. package/dist/editor/types.d.ts +4 -0
  82. package/dist/editor/types.js +1 -0
  83. package/dist/environment/Environment.d.ts +5 -0
  84. package/dist/environment/Environment.js +89 -0
  85. package/dist/environment/environmentOptions.d.ts +1 -0
  86. package/dist/environment/environmentOptions.js +2 -0
  87. package/dist/environment/index.d.ts +2 -0
  88. package/dist/environment/index.js +1 -0
  89. package/dist/environment/types.d.ts +10 -0
  90. package/dist/environment/types.js +1 -0
  91. package/dist/events/EventEmitter.d.ts +14 -0
  92. package/dist/events/EventEmitter.js +42 -0
  93. package/dist/events/index.d.ts +2 -0
  94. package/dist/events/index.js +1 -0
  95. package/dist/events/types.d.ts +88 -0
  96. package/dist/events/types.js +1 -0
  97. package/dist/expect/AbilityMatcherBase.d.ts +16 -0
  98. package/dist/expect/AbilityMatcherBase.js +52 -0
  99. package/dist/expect/Ensure.d.ts +10 -0
  100. package/dist/expect/Ensure.js +51 -0
  101. package/dist/expect/ExpectDiagnosticText.d.ts +29 -0
  102. package/dist/expect/ExpectDiagnosticText.js +87 -0
  103. package/dist/expect/ExpectService.d.ts +21 -0
  104. package/dist/expect/ExpectService.js +90 -0
  105. package/dist/expect/RelationMatcherBase.d.ts +12 -0
  106. package/dist/expect/RelationMatcherBase.js +16 -0
  107. package/dist/expect/ToAcceptProps.d.ts +10 -0
  108. package/dist/expect/ToAcceptProps.js +52 -0
  109. package/dist/expect/ToBe.d.ts +13 -0
  110. package/dist/expect/ToBe.js +18 -0
  111. package/dist/expect/ToBeApplicable.d.ts +10 -0
  112. package/dist/expect/ToBeApplicable.js +72 -0
  113. package/dist/expect/ToBeAssignableFrom.d.ts +9 -0
  114. package/dist/expect/ToBeAssignableFrom.js +12 -0
  115. package/dist/expect/ToBeAssignableTo.d.ts +9 -0
  116. package/dist/expect/ToBeAssignableTo.js +12 -0
  117. package/dist/expect/ToBeCallableWith.d.ts +11 -0
  118. package/dist/expect/ToBeCallableWith.js +29 -0
  119. package/dist/expect/ToBeConstructableWith.d.ts +11 -0
  120. package/dist/expect/ToBeConstructableWith.js +29 -0
  121. package/dist/expect/ToBeInstantiableWith.d.ts +10 -0
  122. package/dist/expect/ToBeInstantiableWith.js +31 -0
  123. package/dist/expect/ToHaveProperty.d.ts +10 -0
  124. package/dist/expect/ToHaveProperty.js +59 -0
  125. package/dist/expect/ToRaiseError.d.ts +9 -0
  126. package/dist/expect/ToRaiseError.js +82 -0
  127. package/dist/expect/index.d.ts +2 -0
  128. package/dist/expect/index.js +1 -0
  129. package/dist/expect/types.d.ts +7 -0
  130. package/dist/expect/types.js +1 -0
  131. package/dist/file/FilePosition.d.ts +7 -0
  132. package/dist/file/FilePosition.js +16 -0
  133. package/dist/file/index.d.ts +1 -0
  134. package/dist/file/index.js +1 -0
  135. package/dist/glob/Braces.d.ts +4 -0
  136. package/dist/glob/Braces.js +56 -0
  137. package/dist/glob/Glob.d.ts +4 -0
  138. package/dist/glob/Glob.js +49 -0
  139. package/dist/glob/index.d.ts +1 -0
  140. package/dist/glob/index.js +1 -0
  141. package/dist/handlers/CancellationHandler.d.ts +7 -0
  142. package/dist/handlers/CancellationHandler.js +15 -0
  143. package/dist/handlers/ExitCodeHandler.d.ts +7 -0
  144. package/dist/handlers/ExitCodeHandler.js +20 -0
  145. package/dist/handlers/ResultHandler.d.ts +5 -0
  146. package/dist/handlers/ResultHandler.js +206 -0
  147. package/dist/handlers/index.d.ts +3 -0
  148. package/dist/handlers/index.js +3 -0
  149. package/dist/index.cjs +5 -5
  150. package/dist/index.d.cts +40 -45
  151. package/dist/index.d.ts +40 -45
  152. package/dist/index.js +1 -2
  153. package/dist/input/InputService.d.ts +6 -0
  154. package/dist/input/InputService.js +16 -0
  155. package/dist/input/index.d.ts +1 -0
  156. package/dist/input/index.js +1 -0
  157. package/dist/json/JsonNode.d.ts +11 -0
  158. package/dist/json/JsonNode.js +28 -0
  159. package/dist/json/JsonScanner.d.ts +14 -0
  160. package/dist/json/JsonScanner.js +105 -0
  161. package/dist/json/index.d.ts +3 -0
  162. package/dist/json/index.js +2 -0
  163. package/dist/json/types.d.ts +1 -0
  164. package/dist/json/types.js +1 -0
  165. package/dist/layers/AbilityLayer.d.ts +10 -0
  166. package/dist/layers/AbilityLayer.js +186 -0
  167. package/dist/layers/Layers.d.ts +11 -0
  168. package/dist/layers/Layers.js +47 -0
  169. package/dist/layers/SuppressedLayer.d.ts +11 -0
  170. package/dist/layers/SuppressedLayer.js +93 -0
  171. package/dist/layers/index.d.ts +2 -0
  172. package/dist/layers/index.js +1 -0
  173. package/dist/layers/types.d.ts +8 -0
  174. package/dist/layers/types.js +1 -0
  175. package/dist/output/CodeFrameText.d.ts +10 -0
  176. package/dist/output/CodeFrameText.js +71 -0
  177. package/dist/output/OutputService.d.ts +13 -0
  178. package/dist/output/OutputService.js +38 -0
  179. package/dist/output/StreamController.d.ts +10 -0
  180. package/dist/output/StreamController.js +16 -0
  181. package/dist/output/addsText.d.ts +4 -0
  182. package/dist/output/addsText.js +8 -0
  183. package/dist/output/describeNameText.d.ts +2 -0
  184. package/dist/output/describeNameText.js +5 -0
  185. package/dist/output/diagnosticText.d.ts +4 -0
  186. package/dist/output/diagnosticText.js +23 -0
  187. package/dist/output/dotText.d.ts +3 -0
  188. package/dist/output/dotText.js +11 -0
  189. package/dist/output/fileStatusText.d.ts +4 -0
  190. package/dist/output/fileStatusText.js +26 -0
  191. package/dist/output/formattedText.d.ts +2 -0
  192. package/dist/output/formattedText.js +19 -0
  193. package/dist/output/helpText.d.ts +3 -0
  194. package/dist/output/helpText.js +52 -0
  195. package/dist/output/helpers.d.ts +5 -0
  196. package/dist/output/helpers.js +23 -0
  197. package/dist/output/index.d.ts +16 -0
  198. package/dist/output/index.js +15 -0
  199. package/dist/output/prologueText.d.ts +2 -0
  200. package/dist/output/prologueText.js +5 -0
  201. package/dist/output/summaryText.d.ts +12 -0
  202. package/dist/output/summaryText.js +31 -0
  203. package/dist/output/testNameText.d.ts +3 -0
  204. package/dist/output/testNameText.js +24 -0
  205. package/dist/output/types.d.ts +5 -0
  206. package/dist/output/types.js +1 -0
  207. package/dist/output/usesText.d.ts +5 -0
  208. package/dist/output/usesText.js +22 -0
  209. package/dist/output/waitingForFileChangesText.d.ts +2 -0
  210. package/dist/output/waitingForFileChangesText.js +5 -0
  211. package/dist/output/watchUsageText.d.ts +2 -0
  212. package/dist/output/watchUsageText.js +12 -0
  213. package/dist/path/Path.d.ts +7 -0
  214. package/dist/path/Path.js +28 -0
  215. package/dist/path/index.d.ts +1 -0
  216. package/dist/path/index.js +1 -0
  217. package/dist/project/CompatMappedDiagnostic.d.ts +12 -0
  218. package/dist/project/CompatMappedDiagnostic.js +25 -0
  219. package/dist/project/CompatProjectService.d.ts +19 -0
  220. package/dist/project/CompatProjectService.js +188 -0
  221. package/dist/project/FileMapService.d.ts +6 -0
  222. package/dist/project/FileMapService.js +14 -0
  223. package/dist/project/NativeMappedDiagnostic.d.ts +14 -0
  224. package/dist/project/NativeMappedDiagnostic.js +29 -0
  225. package/dist/project/NativeProjectService.d.ts +21 -0
  226. package/dist/project/NativeProjectService.js +216 -0
  227. package/dist/project/ProjectConfigService.d.ts +8 -0
  228. package/dist/project/ProjectConfigService.js +73 -0
  229. package/dist/project/index.d.ts +3 -0
  230. package/dist/project/index.js +2 -0
  231. package/dist/project/types.d.ts +7 -0
  232. package/dist/project/types.js +1 -0
  233. package/dist/reject/Reject.d.ts +9 -0
  234. package/dist/reject/Reject.js +43 -0
  235. package/dist/reject/RejectDiagnosticText.d.ts +5 -0
  236. package/dist/reject/RejectDiagnosticText.js +16 -0
  237. package/dist/reject/helpers.d.ts +1 -0
  238. package/dist/reject/helpers.js +3 -0
  239. package/dist/reject/index.d.ts +1 -0
  240. package/dist/reject/index.js +1 -0
  241. package/dist/reporters/BaseReporter.d.ts +7 -0
  242. package/dist/reporters/BaseReporter.js +6 -0
  243. package/dist/reporters/DotReporter.d.ts +6 -0
  244. package/dist/reporters/DotReporter.js +51 -0
  245. package/dist/reporters/FileView.d.ts +13 -0
  246. package/dist/reporters/FileView.js +33 -0
  247. package/dist/reporters/ListReporter.d.ts +6 -0
  248. package/dist/reporters/ListReporter.js +125 -0
  249. package/dist/reporters/SetupReporter.d.ts +4 -0
  250. package/dist/reporters/SetupReporter.js +21 -0
  251. package/dist/reporters/SummaryReporter.d.ts +5 -0
  252. package/dist/reporters/SummaryReporter.js +19 -0
  253. package/dist/reporters/WatchReporter.d.ts +5 -0
  254. package/dist/reporters/WatchReporter.js +21 -0
  255. package/dist/reporters/index.d.ts +7 -0
  256. package/dist/reporters/index.js +6 -0
  257. package/dist/reporters/types.d.ts +5 -0
  258. package/dist/reporters/types.js +1 -0
  259. package/dist/result/DescribeResult.d.ts +9 -0
  260. package/dist/result/DescribeResult.js +11 -0
  261. package/dist/result/ExpectResult.d.ts +10 -0
  262. package/dist/result/ExpectResult.js +11 -0
  263. package/dist/result/FileResult.d.ts +15 -0
  264. package/dist/result/FileResult.js +13 -0
  265. package/dist/result/ProjectConfigKind.enum.d.ts +6 -0
  266. package/dist/result/ProjectConfigKind.enum.js +7 -0
  267. package/dist/result/ProjectResult.d.ts +8 -0
  268. package/dist/result/ProjectResult.js +9 -0
  269. package/dist/result/Result.d.ts +13 -0
  270. package/dist/result/Result.js +14 -0
  271. package/dist/result/ResultStatus.enum.d.ts +10 -0
  272. package/dist/result/ResultStatus.enum.js +11 -0
  273. package/dist/result/SuppressedResult.d.ts +5 -0
  274. package/dist/result/SuppressedResult.js +6 -0
  275. package/dist/result/TargetResult.d.ts +11 -0
  276. package/dist/result/TargetResult.js +12 -0
  277. package/dist/result/TestResult.d.ts +13 -0
  278. package/dist/result/TestResult.js +13 -0
  279. package/dist/result/helpers.d.ts +7 -0
  280. package/dist/result/helpers.js +21 -0
  281. package/dist/result/index.d.ts +11 -0
  282. package/dist/result/index.js +10 -0
  283. package/dist/result/types.d.ts +31 -0
  284. package/dist/result/types.js +1 -0
  285. package/dist/runner/FileRunner.d.ts +10 -0
  286. package/dist/runner/FileRunner.js +93 -0
  287. package/dist/runner/FixmeDiagnosticText.d.ts +4 -0
  288. package/dist/runner/FixmeDiagnosticText.js +8 -0
  289. package/dist/runner/FixmeService.d.ts +9 -0
  290. package/dist/runner/FixmeService.js +51 -0
  291. package/dist/runner/RunModeFlags.enum.d.ts +7 -0
  292. package/dist/runner/RunModeFlags.enum.js +8 -0
  293. package/dist/runner/Runner.d.ts +9 -0
  294. package/dist/runner/Runner.js +101 -0
  295. package/dist/runner/TestTreeWalker.d.ts +19 -0
  296. package/dist/runner/TestTreeWalker.js +169 -0
  297. package/dist/runner/index.d.ts +1 -0
  298. package/dist/runner/index.js +1 -0
  299. package/dist/scribbler/Color.enum.d.ts +10 -0
  300. package/dist/scribbler/Color.enum.js +11 -0
  301. package/dist/scribbler/Line.d.ts +9 -0
  302. package/dist/scribbler/Line.js +5 -0
  303. package/dist/scribbler/Scribbler.d.ts +10 -0
  304. package/dist/scribbler/Scribbler.js +53 -0
  305. package/dist/scribbler/Text.d.ts +9 -0
  306. package/dist/scribbler/Text.js +8 -0
  307. package/dist/scribbler/index.d.ts +5 -0
  308. package/dist/scribbler/index.js +4 -0
  309. package/dist/scribbler/jsxRuntime.d.ts +4 -0
  310. package/dist/scribbler/jsxRuntime.js +4 -0
  311. package/dist/scribbler/types.d.ts +19 -0
  312. package/dist/scribbler/types.js +1 -0
  313. package/dist/select/Select.d.ts +7 -0
  314. package/dist/select/Select.js +91 -0
  315. package/dist/select/SelectDiagnosticText.d.ts +6 -0
  316. package/dist/select/SelectDiagnosticText.js +24 -0
  317. package/dist/select/index.d.ts +2 -0
  318. package/dist/select/index.js +2 -0
  319. package/dist/store/Fetcher.d.ts +24 -0
  320. package/dist/store/Fetcher.js +68 -0
  321. package/dist/store/Lock.d.ts +5 -0
  322. package/dist/store/Lock.js +24 -0
  323. package/dist/store/LockService.d.ts +8 -0
  324. package/dist/store/LockService.js +36 -0
  325. package/dist/store/Manifest.d.ts +30 -0
  326. package/dist/store/Manifest.js +58 -0
  327. package/dist/store/ManifestService.d.ts +10 -0
  328. package/dist/store/ManifestService.js +91 -0
  329. package/dist/store/PackageService.d.ts +9 -0
  330. package/dist/store/PackageService.js +89 -0
  331. package/dist/store/Store.d.ts +12 -0
  332. package/dist/store/Store.js +103 -0
  333. package/dist/store/StoreDiagnosticText.d.ts +13 -0
  334. package/dist/store/StoreDiagnosticText.js +42 -0
  335. package/dist/store/TarReader.d.ts +9 -0
  336. package/dist/store/TarReader.js +56 -0
  337. package/dist/store/helpers.d.ts +1 -0
  338. package/dist/store/helpers.js +3 -0
  339. package/dist/store/index.d.ts +1 -0
  340. package/dist/store/index.js +1 -0
  341. package/dist/structure/ComparisonResult.enum.d.ts +5 -0
  342. package/dist/structure/ComparisonResult.enum.js +6 -0
  343. package/dist/structure/Structure.d.ts +24 -0
  344. package/dist/structure/Structure.js +481 -0
  345. package/dist/structure/index.d.ts +1 -0
  346. package/dist/structure/index.js +1 -0
  347. package/dist/suppressed/SuppressedDiagnosticText.d.ts +6 -0
  348. package/dist/suppressed/SuppressedDiagnosticText.js +18 -0
  349. package/dist/suppressed/SuppressedService.d.ts +5 -0
  350. package/dist/suppressed/SuppressedService.js +61 -0
  351. package/dist/suppressed/index.d.ts +1 -0
  352. package/dist/suppressed/index.js +1 -0
  353. package/dist/tag.d.ts +1 -3
  354. package/dist/tag.js +2 -5
  355. package/dist/text/TextFile.d.ts +11 -0
  356. package/dist/text/TextFile.js +41 -0
  357. package/dist/text/TextFileService.d.ts +10 -0
  358. package/dist/text/TextFileService.js +31 -0
  359. package/dist/text/index.d.ts +3 -0
  360. package/dist/text/index.js +2 -0
  361. package/dist/text/types.d.ts +5 -0
  362. package/dist/text/types.js +1 -0
  363. package/dist/token/CancellationReason.enum.d.ts +6 -0
  364. package/dist/token/CancellationReason.enum.js +7 -0
  365. package/dist/token/CancellationToken.d.ts +8 -0
  366. package/dist/token/CancellationToken.js +22 -0
  367. package/dist/token/index.d.ts +2 -0
  368. package/dist/token/index.js +2 -0
  369. package/dist/typescript/BaseAdapter.d.ts +36 -0
  370. package/dist/typescript/BaseAdapter.js +83 -0
  371. package/dist/typescript/CompatTypeScript.d.ts +21 -0
  372. package/dist/typescript/CompatTypeScript.js +37 -0
  373. package/dist/typescript/NativeTypeScript.d.ts +24 -0
  374. package/dist/typescript/NativeTypeScript.js +44 -0
  375. package/dist/typescript/index.d.ts +3 -0
  376. package/dist/typescript/index.js +2 -0
  377. package/dist/typescript/types.d.ts +69 -0
  378. package/dist/typescript/types.js +1 -0
  379. package/dist/version/Version.d.ts +6 -0
  380. package/dist/version/Version.js +30 -0
  381. package/dist/version/index.d.ts +1 -0
  382. package/dist/version/index.js +1 -0
  383. package/dist/watch/Debounce.d.ts +9 -0
  384. package/dist/watch/Debounce.js +27 -0
  385. package/dist/watch/FileWatcher.d.ts +5 -0
  386. package/dist/watch/FileWatcher.js +12 -0
  387. package/dist/watch/WatchService.d.ts +8 -0
  388. package/dist/watch/WatchService.js +96 -0
  389. package/dist/watch/Watcher.d.ts +10 -0
  390. package/dist/watch/Watcher.js +31 -0
  391. package/dist/watch/index.d.ts +3 -0
  392. package/dist/watch/index.js +3 -0
  393. package/package.json +10 -2
package/dist/index.d.cts CHANGED
@@ -1,34 +1,3 @@
1
- interface Describe {
2
- /**
3
- * Defines a group of tests.
4
- *
5
- * @param name - The name of the group.
6
- * @param callback - The function to create a scope for a group of tests.
7
- */
8
- (name: string, callback: () => void | Promise<void>): void;
9
- /**
10
- * Marks a group of tests as focused.
11
- *
12
- * @param name - The name of the group.
13
- * @param callback - The function to create a scope for a group of tests.
14
- */
15
- only: (name: string, callback: () => void | Promise<void>) => void;
16
- /**
17
- * Marks a group of tests as skipped.
18
- *
19
- * @param name - The name of the group.
20
- * @param callback - The function to create a scope for a group of tests.
21
- */
22
- skip: (name: string, callback: () => void | Promise<void>) => void;
23
- /**
24
- * Marks a group of tests as yet to be implemented.
25
- *
26
- * @param name - The name of the group.
27
- * @param callback - The function to create a scope for a group of tests.
28
- */
29
- todo: (name: string, callback?: () => void | Promise<void>) => void;
30
- }
31
-
32
1
  interface Matchers {
33
2
  /**
34
3
  * Checks if the type is the same as the given type.
@@ -115,7 +84,7 @@ interface Modifier {
115
84
  not: Matchers;
116
85
  };
117
86
  }
118
- interface Expect {
87
+ export interface Expect {
119
88
  /**
120
89
  * Builds an assertion.
121
90
  */
@@ -151,8 +120,37 @@ interface Expect {
151
120
  (source: unknown): Modifier;
152
121
  };
153
122
  }
154
-
155
- interface Test {
123
+ export interface Describe {
124
+ /**
125
+ * Defines a group of tests.
126
+ *
127
+ * @param name - The name of the group.
128
+ * @param callback - The function to create a scope for a group of tests.
129
+ */
130
+ (name: string, callback: () => void | Promise<void>): void;
131
+ /**
132
+ * Marks a group of tests as focused.
133
+ *
134
+ * @param name - The name of the group.
135
+ * @param callback - The function to create a scope for a group of tests.
136
+ */
137
+ only: (name: string, callback: () => void | Promise<void>) => void;
138
+ /**
139
+ * Marks a group of tests as skipped.
140
+ *
141
+ * @param name - The name of the group.
142
+ * @param callback - The function to create a scope for a group of tests.
143
+ */
144
+ skip: (name: string, callback: () => void | Promise<void>) => void;
145
+ /**
146
+ * Marks a group of tests as yet to be implemented.
147
+ *
148
+ * @param name - The name of the group.
149
+ * @param callback - The function to create a scope for a group of tests.
150
+ */
151
+ todo: (name: string, callback?: () => void | Promise<void>) => void;
152
+ }
153
+ export interface Test {
156
154
  /**
157
155
  * Defines a single test.
158
156
  *
@@ -182,35 +180,32 @@ interface Test {
182
180
  */
183
181
  todo: (name: string, callback?: () => void | Promise<void>) => void;
184
182
  }
185
-
186
183
  /**
187
184
  * The fill-in type. Useful to fill in the required type arguments of generic types.
188
185
  */
189
- type _ = never;
186
+ export type _ = never;
190
187
  /**
191
188
  * Builds an assertion.
192
189
  */
193
- declare const expect: Expect;
190
+ export declare const expect: Expect;
194
191
  /**
195
192
  * Reshapes type of the given object by removing the specified keys.
196
193
  */
197
- declare function omit<T, K extends PropertyKey>(object: T, ...keys: [K, ...Array<K>]): Omit<T, K>;
194
+ export declare function omit<T, K extends PropertyKey>(object: T, ...keys: [K, ...Array<K>]): Omit<T, K>;
198
195
  /**
199
196
  * Reshapes type of the given object by keeping only the specified keys.
200
197
  */
201
- declare function pick<T, K extends keyof T>(object: T, ...keys: [K, ...Array<K>]): Pick<T, K>;
198
+ export declare function pick<T, K extends keyof T>(object: T, ...keys: [K, ...Array<K>]): Pick<T, K>;
202
199
  /**
203
200
  * Defines a test group.
204
201
  */
205
- declare const describe: Describe;
202
+ export declare const describe: Describe;
206
203
  /**
207
204
  * Defines a single test.
208
205
  */
209
- declare const it: Test;
206
+ export declare const it: Test;
210
207
  /**
211
208
  * Defines a single test.
212
209
  */
213
- declare const test: Test;
214
-
215
- export { describe, expect, it, omit, pick, test };
216
- export type { _ };
210
+ export declare const test: Test;
211
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,34 +1,3 @@
1
- interface Describe {
2
- /**
3
- * Defines a group of tests.
4
- *
5
- * @param name - The name of the group.
6
- * @param callback - The function to create a scope for a group of tests.
7
- */
8
- (name: string, callback: () => void | Promise<void>): void;
9
- /**
10
- * Marks a group of tests as focused.
11
- *
12
- * @param name - The name of the group.
13
- * @param callback - The function to create a scope for a group of tests.
14
- */
15
- only: (name: string, callback: () => void | Promise<void>) => void;
16
- /**
17
- * Marks a group of tests as skipped.
18
- *
19
- * @param name - The name of the group.
20
- * @param callback - The function to create a scope for a group of tests.
21
- */
22
- skip: (name: string, callback: () => void | Promise<void>) => void;
23
- /**
24
- * Marks a group of tests as yet to be implemented.
25
- *
26
- * @param name - The name of the group.
27
- * @param callback - The function to create a scope for a group of tests.
28
- */
29
- todo: (name: string, callback?: () => void | Promise<void>) => void;
30
- }
31
-
32
1
  interface Matchers {
33
2
  /**
34
3
  * Checks if the type is the same as the given type.
@@ -115,7 +84,7 @@ interface Modifier {
115
84
  not: Matchers;
116
85
  };
117
86
  }
118
- interface Expect {
87
+ export interface Expect {
119
88
  /**
120
89
  * Builds an assertion.
121
90
  */
@@ -151,8 +120,37 @@ interface Expect {
151
120
  (source: unknown): Modifier;
152
121
  };
153
122
  }
154
-
155
- interface Test {
123
+ export interface Describe {
124
+ /**
125
+ * Defines a group of tests.
126
+ *
127
+ * @param name - The name of the group.
128
+ * @param callback - The function to create a scope for a group of tests.
129
+ */
130
+ (name: string, callback: () => void | Promise<void>): void;
131
+ /**
132
+ * Marks a group of tests as focused.
133
+ *
134
+ * @param name - The name of the group.
135
+ * @param callback - The function to create a scope for a group of tests.
136
+ */
137
+ only: (name: string, callback: () => void | Promise<void>) => void;
138
+ /**
139
+ * Marks a group of tests as skipped.
140
+ *
141
+ * @param name - The name of the group.
142
+ * @param callback - The function to create a scope for a group of tests.
143
+ */
144
+ skip: (name: string, callback: () => void | Promise<void>) => void;
145
+ /**
146
+ * Marks a group of tests as yet to be implemented.
147
+ *
148
+ * @param name - The name of the group.
149
+ * @param callback - The function to create a scope for a group of tests.
150
+ */
151
+ todo: (name: string, callback?: () => void | Promise<void>) => void;
152
+ }
153
+ export interface Test {
156
154
  /**
157
155
  * Defines a single test.
158
156
  *
@@ -182,35 +180,32 @@ interface Test {
182
180
  */
183
181
  todo: (name: string, callback?: () => void | Promise<void>) => void;
184
182
  }
185
-
186
183
  /**
187
184
  * The fill-in type. Useful to fill in the required type arguments of generic types.
188
185
  */
189
- type _ = never;
186
+ export type _ = never;
190
187
  /**
191
188
  * Builds an assertion.
192
189
  */
193
- declare const expect: Expect;
190
+ export declare const expect: Expect;
194
191
  /**
195
192
  * Reshapes type of the given object by removing the specified keys.
196
193
  */
197
- declare function omit<T, K extends PropertyKey>(object: T, ...keys: [K, ...Array<K>]): Omit<T, K>;
194
+ export declare function omit<T, K extends PropertyKey>(object: T, ...keys: [K, ...Array<K>]): Omit<T, K>;
198
195
  /**
199
196
  * Reshapes type of the given object by keeping only the specified keys.
200
197
  */
201
- declare function pick<T, K extends keyof T>(object: T, ...keys: [K, ...Array<K>]): Pick<T, K>;
198
+ export declare function pick<T, K extends keyof T>(object: T, ...keys: [K, ...Array<K>]): Pick<T, K>;
202
199
  /**
203
200
  * Defines a test group.
204
201
  */
205
- declare const describe: Describe;
202
+ export declare const describe: Describe;
206
203
  /**
207
204
  * Defines a single test.
208
205
  */
209
- declare const it: Test;
206
+ export declare const it: Test;
210
207
  /**
211
208
  * Defines a single test.
212
209
  */
213
- declare const test: Test;
214
-
215
- export { describe, expect, it, omit, pick, test };
216
- export type { _ };
210
+ export declare const test: Test;
211
+ export {};
package/dist/index.js CHANGED
@@ -8,5 +8,4 @@ const noopChain = new Proxy(noop, {
8
8
  return noopChain;
9
9
  },
10
10
  });
11
-
12
- export { noopChain as describe, noopChain as expect, noopChain as it, noop as omit, noop as pick, noopChain as test };
11
+ export { noop as omit, noop as pick, noopChain as describe, noopChain as expect, noopChain as it, noopChain as test };
@@ -0,0 +1,6 @@
1
+ export type InputHandler = (chunk: string) => void;
2
+ export declare class InputService {
3
+ #private;
4
+ constructor(onInput: InputHandler);
5
+ close(): void;
6
+ }
@@ -0,0 +1,16 @@
1
+ import process from "node:process";
2
+ export class InputService {
3
+ #onInput;
4
+ #stdin = process.stdin;
5
+ constructor(onInput) {
6
+ this.#onInput = onInput;
7
+ this.#stdin.setRawMode?.(true);
8
+ this.#stdin.setEncoding("utf8");
9
+ this.#stdin.unref();
10
+ this.#stdin.addListener("data", this.#onInput);
11
+ }
12
+ close() {
13
+ this.#stdin.removeListener("data", this.#onInput);
14
+ this.#stdin.setRawMode?.(false);
15
+ }
16
+ }
@@ -0,0 +1 @@
1
+ export { type InputHandler, InputService } from "./InputService.js";
@@ -0,0 +1 @@
1
+ export { InputService } from "./InputService.js";
@@ -0,0 +1,11 @@
1
+ import type { DiagnosticOrigin } from "#diagnostic";
2
+ import type { OptionValue } from "./types.js";
3
+ export declare class JsonNode {
4
+ origin: DiagnosticOrigin;
5
+ text: string | undefined;
6
+ constructor(text: string | undefined, origin: DiagnosticOrigin);
7
+ getValue(): OptionValue;
8
+ getValue(options: {
9
+ expectsIdentifier: true;
10
+ }): string | undefined;
11
+ }
@@ -0,0 +1,28 @@
1
+ export class JsonNode {
2
+ origin;
3
+ text;
4
+ constructor(text, origin) {
5
+ this.origin = origin;
6
+ this.text = text;
7
+ }
8
+ getValue(options) {
9
+ if (this.text != null) {
10
+ if (/^['"]/.test(this.text)) {
11
+ return this.text.slice(1, -1).replaceAll("\\", "");
12
+ }
13
+ if (options?.expectsIdentifier) {
14
+ return this.text;
15
+ }
16
+ if (this.text === "true") {
17
+ return true;
18
+ }
19
+ if (this.text === "false") {
20
+ return false;
21
+ }
22
+ if (/^\d/.test(this.text)) {
23
+ return Number.parseFloat(this.text);
24
+ }
25
+ }
26
+ return;
27
+ }
28
+ }
@@ -0,0 +1,14 @@
1
+ import type { TextFile } from "#text";
2
+ import { JsonNode } from "./JsonNode.js";
3
+ export interface JsonScannerOptions {
4
+ start?: number;
5
+ end?: number;
6
+ }
7
+ export declare class JsonScanner {
8
+ #private;
9
+ constructor(file: TextFile, options?: JsonScannerOptions);
10
+ isRead(): boolean;
11
+ peekToken(token: string): boolean;
12
+ read(): JsonNode;
13
+ readToken(token: string | RegExp): JsonNode;
14
+ }
@@ -0,0 +1,105 @@
1
+ import { DiagnosticOrigin } from "#diagnostic";
2
+ import { JsonNode } from "./JsonNode.js";
3
+ export class JsonScanner {
4
+ #end;
5
+ #file;
6
+ #position;
7
+ #previousPosition;
8
+ constructor(file, options) {
9
+ this.#file = file;
10
+ this.#end = options?.end ?? file.text.length;
11
+ this.#position = options?.start ?? 0;
12
+ this.#previousPosition = options?.start ?? 0;
13
+ }
14
+ #getOrigin() {
15
+ return new DiagnosticOrigin(this.#previousPosition, this.#position, this.#file);
16
+ }
17
+ isRead() {
18
+ return !(this.#position < this.#end);
19
+ }
20
+ #peekCharacter() {
21
+ return this.#file.text.charAt(this.#position);
22
+ }
23
+ #peekNextCharacter() {
24
+ return this.#file.text.charAt(this.#position + 1);
25
+ }
26
+ peekToken(token) {
27
+ this.#skipTrivia();
28
+ return this.#peekCharacter() === token;
29
+ }
30
+ read() {
31
+ this.#skipTrivia();
32
+ this.#previousPosition = this.#position;
33
+ if (/[\s,:\]}]/.test(this.#peekCharacter())) {
34
+ return new JsonNode(undefined, this.#getOrigin());
35
+ }
36
+ let text = "";
37
+ let closingTokenText = "";
38
+ if (/[[{'"]/.test(this.#peekCharacter())) {
39
+ text += this.#readCharacter();
40
+ switch (text) {
41
+ case "[":
42
+ closingTokenText = "]";
43
+ break;
44
+ case "{":
45
+ closingTokenText = "}";
46
+ break;
47
+ default:
48
+ closingTokenText = text;
49
+ }
50
+ }
51
+ while (!this.isRead()) {
52
+ text += this.#readCharacter();
53
+ if ((text.at(-2) !== "\\" && text.at(-1) === closingTokenText) ||
54
+ (!closingTokenText && /[\s,:\]}]/.test(this.#peekCharacter()))) {
55
+ break;
56
+ }
57
+ }
58
+ return new JsonNode(text, this.#getOrigin());
59
+ }
60
+ #readCharacter() {
61
+ return this.#file.text.charAt(this.#position++);
62
+ }
63
+ readToken(token) {
64
+ this.#skipTrivia();
65
+ this.#previousPosition = this.#position;
66
+ const character = this.#peekCharacter();
67
+ if (typeof token === "string" ? token === character : token.test(character)) {
68
+ this.#position++;
69
+ return new JsonNode(character, this.#getOrigin());
70
+ }
71
+ return new JsonNode(undefined, this.#getOrigin());
72
+ }
73
+ #skipTrivia() {
74
+ while (!this.isRead()) {
75
+ if (/\s/.test(this.#peekCharacter())) {
76
+ this.#position++;
77
+ continue;
78
+ }
79
+ if (this.#peekCharacter() === "/") {
80
+ if (this.#peekNextCharacter() === "/") {
81
+ this.#position += 2;
82
+ while (!this.isRead()) {
83
+ if (this.#readCharacter() === "\n") {
84
+ break;
85
+ }
86
+ }
87
+ continue;
88
+ }
89
+ if (this.#peekNextCharacter() === "*") {
90
+ this.#position += 2;
91
+ while (!this.isRead()) {
92
+ if (this.#peekCharacter() === "*" && this.#peekNextCharacter() === "/") {
93
+ this.#position += 2;
94
+ break;
95
+ }
96
+ this.#position++;
97
+ }
98
+ continue;
99
+ }
100
+ }
101
+ break;
102
+ }
103
+ this.#previousPosition = this.#position;
104
+ }
105
+ }
@@ -0,0 +1,3 @@
1
+ export { JsonNode } from "./JsonNode.js";
2
+ export { JsonScanner, type JsonScannerOptions } from "./JsonScanner.js";
3
+ export type { OptionValue } from "./types.js";
@@ -0,0 +1,2 @@
1
+ export { JsonNode } from "./JsonNode.js";
2
+ export { JsonScanner } from "./JsonScanner.js";
@@ -0,0 +1 @@
1
+ export type OptionValue = Array<OptionValue> | string | number | boolean | null | undefined;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { ExpectNode } from "#collect";
2
+ import type { TextEditor } from "#editor";
3
+ import type * as ts from "#typescript";
4
+ export declare class AbilityLayer {
5
+ #private;
6
+ constructor(ts: ts.TypeScript, editor: TextEditor);
7
+ close(diagnostics: Array<ts.Diagnostic>): void;
8
+ hasChanges(): boolean;
9
+ visitExpect(expect: ExpectNode): void;
10
+ }
@@ -0,0 +1,186 @@
1
+ import { diagnosticBelongsToNode } from "#diagnostic";
2
+ export class AbilityLayer {
3
+ #editor;
4
+ #nodes = [];
5
+ #ts;
6
+ constructor(ts, editor) {
7
+ this.#ts = ts;
8
+ this.#editor = editor;
9
+ }
10
+ close(diagnostics) {
11
+ if (diagnostics.length > 0 && this.hasChanges()) {
12
+ this.#nodes.reverse();
13
+ for (const diagnostic of diagnostics) {
14
+ for (const node of this.#nodes) {
15
+ if (diagnosticBelongsToNode(diagnostic, node.matcherNode) ||
16
+ diagnosticBelongsToNode(diagnostic, node.source)) {
17
+ node.abilityDiagnostics.add(diagnostic);
18
+ break;
19
+ }
20
+ }
21
+ }
22
+ }
23
+ this.#nodes = [];
24
+ }
25
+ hasChanges() {
26
+ return this.#nodes.length > 0;
27
+ }
28
+ visitExpect(expect) {
29
+ const expectStart = expect.node.getStart();
30
+ const expectExpressionEnd = expect.node.expression.getEnd();
31
+ const expectEnd = expect.node.getEnd();
32
+ const matcherNameEnd = expect.matcherNameNode.getEnd();
33
+ const matcherNodeEnd = expect.matcherNode.getEnd();
34
+ switch (expect.matcherNameNode.name.text) {
35
+ case "toAcceptProps": {
36
+ this.#nodes.push(expect);
37
+ const sourceNode = expect.source[0];
38
+ const targetNode = expect.target?.[0];
39
+ if (!sourceNode ||
40
+ !targetNode ||
41
+ !this.#ts.isCapitaizedIdentifierLike(sourceNode) ||
42
+ !this.#ts.isObjectLiteralExpression(targetNode) ||
43
+ !targetNode.properties.every((property) => (this.#ts.isPropertyAssignment(property) &&
44
+ (this.#ts.isIdentifier(property.name) || this.#ts.isStringLiteral(property.name))) ||
45
+ this.#ts.isSpreadAssignment(property))) {
46
+ return;
47
+ }
48
+ const sourceText = sourceNode.getText();
49
+ if (this.#ts.belongsToArgumentList(sourceNode)) {
50
+ this.#editor
51
+ .eraseTrailingComma(expect.source)
52
+ .erase(expectStart, matcherNodeEnd)
53
+ .update(expectStart, matcherNameEnd, this.#ts.isChildOfExpressionStatement(expect.matcherNode) ? ";" : "")
54
+ .update(sourceNode.getStart() - 1, sourceNode.getEnd(), `<${sourceText}`);
55
+ }
56
+ else {
57
+ const id = ["SC", expectStart, Date.now().toString(36)].join("_");
58
+ this.#editor
59
+ .erase(expectStart, matcherNodeEnd)
60
+ .update(expectStart, matcherNameEnd, this.#ts.isChildOfExpressionStatement(expect.matcherNode)
61
+ ? `;const ${id} = undefined as any as ${sourceText};<${id}`
62
+ : `const ${id} = undefined as any as ${sourceText};<${id}`);
63
+ }
64
+ for (const property of targetNode.properties) {
65
+ if (this.#ts.isPropertyAssignment(property)) {
66
+ this.#editor
67
+ .update(property.name.getStart(), property.name.getEnd(), this.#ts.isStringLiteral(property.name)
68
+ ? ` ${property.name.getText().slice(1, -1)} `
69
+ : property.name.getText())
70
+ .insert(property.initializer.getStart(), "={")
71
+ .update(property.initializer.getStart(), property.initializer.getEnd(), property.initializer.getText())
72
+ .insert(property.initializer.getEnd(), "}");
73
+ continue;
74
+ }
75
+ if (this.#ts.isSpreadAssignment(property)) {
76
+ this.#editor
77
+ .insert(property.getStart(), "{")
78
+ .update(property.getStart(), property.getEnd(), property.getText())
79
+ .insert(property.getEnd(), "}");
80
+ }
81
+ }
82
+ this.#editor.insert(matcherNodeEnd, "/>");
83
+ break;
84
+ }
85
+ case "toBeApplicable":
86
+ this.#nodes.push(expect);
87
+ this.#editor.erase(expectStart, expectExpressionEnd).erase(expectEnd, matcherNameEnd);
88
+ break;
89
+ case "toBeCallableWith": {
90
+ this.#nodes.push(expect);
91
+ const sourceNode = expect.source[0];
92
+ if (!sourceNode) {
93
+ return;
94
+ }
95
+ if (this.#ts.belongsToArgumentList(sourceNode)) {
96
+ this.#editor
97
+ .eraseTrailingComma(expect.source)
98
+ .update(expectStart, expectExpressionEnd, this.#ts.isChildOfExpressionStatement(expect.matcherNode) ? ";" : "")
99
+ .erase(expectEnd, matcherNameEnd);
100
+ }
101
+ else {
102
+ const sourceText = sourceNode.getFullText();
103
+ this.#editor.update(expectStart, matcherNameEnd, this.#ts.isChildOfExpressionStatement(expect.matcherNode)
104
+ ? `;(undefined as any as ${sourceText})`
105
+ : `(undefined as any as ${sourceText})`);
106
+ }
107
+ break;
108
+ }
109
+ case "toBeConstructableWith": {
110
+ this.#nodes.push(expect);
111
+ const sourceNode = expect.source[0];
112
+ if (!sourceNode) {
113
+ return;
114
+ }
115
+ if (this.#ts.belongsToArgumentList(sourceNode)) {
116
+ this.#editor
117
+ .eraseTrailingComma(expect.source)
118
+ .update(expectStart, expectExpressionEnd, this.#ts.isChildOfExpressionStatement(expect.matcherNode) ? "; new" : "new")
119
+ .erase(expectEnd, matcherNameEnd);
120
+ }
121
+ else {
122
+ const sourceText = sourceNode.getFullText();
123
+ this.#editor.update(expectStart, matcherNameEnd, this.#ts.isChildOfExpressionStatement(expect.matcherNode)
124
+ ? `;new (undefined as any as ${sourceText})`
125
+ : `new (undefined as any as ${sourceText})`);
126
+ }
127
+ break;
128
+ }
129
+ case "toBeInstantiableWith": {
130
+ this.#nodes.push(expect);
131
+ const sourceNode = expect.source[0];
132
+ const targetNode = expect.target?.[0];
133
+ if (!sourceNode || !targetNode || !this.#ts.isIdentifierLike(sourceNode)) {
134
+ return;
135
+ }
136
+ if (this.#ts.belongsToArgumentList(sourceNode)) {
137
+ this.#editor
138
+ .eraseTrailingComma(expect.source)
139
+ .update(expectStart, expectExpressionEnd, this.#ts.isChildOfExpressionStatement(expect.matcherNode) ? ";" : "")
140
+ .erase(expectEnd, matcherNodeEnd);
141
+ if (this.#ts.isExpressionWithTypeArguments(sourceNode)) {
142
+ this.#editor.erase(sourceNode.expression.getEnd(), sourceNode.getEnd());
143
+ }
144
+ }
145
+ else {
146
+ const sourceText = this.#ts.isTypeReferenceNode(sourceNode)
147
+ ? sourceNode.typeName.getFullText()
148
+ : sourceNode.getFullText();
149
+ this.#editor.update(expectStart, matcherNodeEnd, this.#ts.isChildOfExpressionStatement(expect.matcherNode)
150
+ ? `;undefined as any as ${sourceText}`
151
+ : `undefined as any as ${sourceText}`);
152
+ }
153
+ const targetText = targetNode.getText().slice(1, -1);
154
+ if (targetText.trim().length > 0) {
155
+ this.#editor.update(targetNode.getFullStart(), targetNode.getEnd(), `<${targetText}>`.padStart(targetNode.getFullWidth()));
156
+ }
157
+ break;
158
+ }
159
+ case "toHaveProperty": {
160
+ this.#nodes.push(expect);
161
+ const sourceNode = expect.source[0];
162
+ const targetNode = expect.target?.[0];
163
+ if (!sourceNode || !targetNode) {
164
+ return;
165
+ }
166
+ if (this.#ts.belongsToArgumentList(sourceNode)) {
167
+ this.#editor
168
+ .eraseTrailingComma(expect.source)
169
+ .update(expectStart, expectExpressionEnd, this.#ts.isChildOfExpressionStatement(expect.matcherNode) ? ";" : "")
170
+ .erase(expectEnd, matcherNodeEnd);
171
+ }
172
+ else {
173
+ const sourceText = sourceNode.getFullText();
174
+ this.#editor.update(expectStart, matcherNodeEnd, this.#ts.isChildOfExpressionStatement(expect.matcherNode)
175
+ ? `;(undefined as any as ${sourceText})`
176
+ : `(undefined as any as ${sourceText})`);
177
+ }
178
+ const targetText = targetNode.getText();
179
+ if (targetText.trim().length > 0) {
180
+ this.#editor.update(targetNode.getFullStart() - 1, targetNode.getEnd() + 1, `[${targetText}]`.padStart(targetNode.getFullWidth()));
181
+ }
182
+ break;
183
+ }
184
+ }
185
+ }
186
+ }
@@ -0,0 +1,11 @@
1
+ import type { ExpectNode, TestTree } from "#collect";
2
+ import type { ResolvedConfig } from "#config";
3
+ import type { ProjectService } from "#project";
4
+ import type * as ts from "#typescript";
5
+ export declare class Layers {
6
+ #private;
7
+ constructor(ts: ts.TypeScript, projectService: ProjectService, resolvedConfig: ResolvedConfig);
8
+ close(tree: TestTree): void;
9
+ open(tree: TestTree): void;
10
+ visit(node: ExpectNode): void;
11
+ }