@ai-dev-tools/test-copilot-core 1.0.19

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 (328) hide show
  1. package/README.md +6 -0
  2. package/azure-pipelines.yml +51 -0
  3. package/out/cli/commands/appInsightTelemetry.d.ts +7 -0
  4. package/out/cli/commands/appInsightTelemetry.d.ts.map +1 -0
  5. package/out/cli/commands/appInsightTelemetry.js +76 -0
  6. package/out/cli/commands/appInsightTelemetry.js.map +1 -0
  7. package/out/cli/commands/cliConfig.d.ts +4 -0
  8. package/out/cli/commands/cliConfig.d.ts.map +1 -0
  9. package/out/cli/commands/cliConfig.js +68 -0
  10. package/out/cli/commands/cliConfig.js.map +1 -0
  11. package/out/cli/commands/prompt.d.ts +6 -0
  12. package/out/cli/commands/prompt.d.ts.map +1 -0
  13. package/out/cli/commands/prompt.js +29 -0
  14. package/out/cli/commands/prompt.js.map +1 -0
  15. package/out/cli/commands/ut.d.ts +14 -0
  16. package/out/cli/commands/ut.d.ts.map +1 -0
  17. package/out/cli/commands/ut.js +72 -0
  18. package/out/cli/commands/ut.js.map +1 -0
  19. package/out/cli/commands/utPipeCmdWrapper.d.ts +18 -0
  20. package/out/cli/commands/utPipeCmdWrapper.d.ts.map +1 -0
  21. package/out/cli/commands/utPipeCmdWrapper.js +37 -0
  22. package/out/cli/commands/utPipeCmdWrapper.js.map +1 -0
  23. package/out/cli/config/index.d.ts +15 -0
  24. package/out/cli/config/index.d.ts.map +1 -0
  25. package/out/cli/config/index.js +10 -0
  26. package/out/cli/config/index.js.map +1 -0
  27. package/out/cli/index.d.ts +3 -0
  28. package/out/cli/index.d.ts.map +1 -0
  29. package/out/cli/index.js +169 -0
  30. package/out/cli/index.js.map +1 -0
  31. package/out/cli/type.d.ts +11 -0
  32. package/out/cli/type.d.ts.map +1 -0
  33. package/out/cli/type.js +3 -0
  34. package/out/cli/type.js.map +1 -0
  35. package/out/cli/utils/ds.d.ts +3 -0
  36. package/out/cli/utils/ds.d.ts.map +1 -0
  37. package/out/cli/utils/ds.js +50 -0
  38. package/out/cli/utils/ds.js.map +1 -0
  39. package/out/cli/utils/gpt.d.ts +3 -0
  40. package/out/cli/utils/gpt.d.ts.map +1 -0
  41. package/out/cli/utils/gpt.js +63 -0
  42. package/out/cli/utils/gpt.js.map +1 -0
  43. package/out/core/analyze/cjs.d.ts +61 -0
  44. package/out/core/analyze/cjs.d.ts.map +1 -0
  45. package/out/core/analyze/cjs.js +358 -0
  46. package/out/core/analyze/cjs.js.map +1 -0
  47. package/out/core/analyze/class.d.ts +4 -0
  48. package/out/core/analyze/class.d.ts.map +1 -0
  49. package/out/core/analyze/class.js +32 -0
  50. package/out/core/analyze/class.js.map +1 -0
  51. package/out/core/analyze/declares.d.ts +7 -0
  52. package/out/core/analyze/declares.d.ts.map +1 -0
  53. package/out/core/analyze/declares.js +316 -0
  54. package/out/core/analyze/declares.js.map +1 -0
  55. package/out/core/analyze/deps.d.ts +8 -0
  56. package/out/core/analyze/deps.d.ts.map +1 -0
  57. package/out/core/analyze/deps.js +210 -0
  58. package/out/core/analyze/deps.js.map +1 -0
  59. package/out/core/analyze/functionComponent.d.ts +4 -0
  60. package/out/core/analyze/functionComponent.d.ts.map +1 -0
  61. package/out/core/analyze/functionComponent.js +77 -0
  62. package/out/core/analyze/functionComponent.js.map +1 -0
  63. package/out/core/analyze/functions.d.ts +4 -0
  64. package/out/core/analyze/functions.d.ts.map +1 -0
  65. package/out/core/analyze/functions.js +46 -0
  66. package/out/core/analyze/functions.js.map +1 -0
  67. package/out/core/analyze/index.d.ts +16 -0
  68. package/out/core/analyze/index.d.ts.map +1 -0
  69. package/out/core/analyze/index.js +149 -0
  70. package/out/core/analyze/index.js.map +1 -0
  71. package/out/core/analyze/index.type.d.ts +69 -0
  72. package/out/core/analyze/index.type.d.ts.map +1 -0
  73. package/out/core/analyze/index.type.js +14 -0
  74. package/out/core/analyze/index.type.js.map +1 -0
  75. package/out/core/analyze/utils/global.d.ts +2 -0
  76. package/out/core/analyze/utils/global.d.ts.map +1 -0
  77. package/out/core/analyze/utils/global.js +84 -0
  78. package/out/core/analyze/utils/global.js.map +1 -0
  79. package/out/core/analyzev2/declare/class.d.ts +4 -0
  80. package/out/core/analyzev2/declare/class.d.ts.map +1 -0
  81. package/out/core/analyzev2/declare/class.js +24 -0
  82. package/out/core/analyzev2/declare/class.js.map +1 -0
  83. package/out/core/analyzev2/declare/funcLike.d.ts +8 -0
  84. package/out/core/analyzev2/declare/funcLike.d.ts.map +1 -0
  85. package/out/core/analyzev2/declare/funcLike.js +71 -0
  86. package/out/core/analyzev2/declare/funcLike.js.map +1 -0
  87. package/out/core/analyzev2/declare/variable.d.ts +3 -0
  88. package/out/core/analyzev2/declare/variable.d.ts.map +1 -0
  89. package/out/core/analyzev2/declare/variable.js +15 -0
  90. package/out/core/analyzev2/declare/variable.js.map +1 -0
  91. package/out/core/analyzev2/file.d.ts +19 -0
  92. package/out/core/analyzev2/file.d.ts.map +1 -0
  93. package/out/core/analyzev2/file.js +449 -0
  94. package/out/core/analyzev2/file.js.map +1 -0
  95. package/out/core/analyzev2/index.d.ts +5 -0
  96. package/out/core/analyzev2/index.d.ts.map +1 -0
  97. package/out/core/analyzev2/index.js +30 -0
  98. package/out/core/analyzev2/index.js.map +1 -0
  99. package/out/core/analyzev2/type.d.ts +35 -0
  100. package/out/core/analyzev2/type.d.ts.map +1 -0
  101. package/out/core/analyzev2/type.js +3 -0
  102. package/out/core/analyzev2/type.js.map +1 -0
  103. package/out/core/config/index.d.ts +25 -0
  104. package/out/core/config/index.d.ts.map +1 -0
  105. package/out/core/config/index.js +14 -0
  106. package/out/core/config/index.js.map +1 -0
  107. package/out/core/constants.d.ts +9 -0
  108. package/out/core/constants.d.ts.map +1 -0
  109. package/out/core/constants.js +12 -0
  110. package/out/core/constants.js.map +1 -0
  111. package/out/core/features/common/base.d.ts +20 -0
  112. package/out/core/features/common/base.d.ts.map +1 -0
  113. package/out/core/features/common/base.js +77 -0
  114. package/out/core/features/common/base.js.map +1 -0
  115. package/out/core/features/common/types.d.ts +16 -0
  116. package/out/core/features/common/types.d.ts.map +1 -0
  117. package/out/core/features/common/types.js +12 -0
  118. package/out/core/features/common/types.js.map +1 -0
  119. package/out/core/features/generateFile.d.ts +31 -0
  120. package/out/core/features/generateFile.d.ts.map +1 -0
  121. package/out/core/features/generateFile.js +148 -0
  122. package/out/core/features/generateFile.js.map +1 -0
  123. package/out/core/features/generateSingle.d.ts +28 -0
  124. package/out/core/features/generateSingle.d.ts.map +1 -0
  125. package/out/core/features/generateSingle.js +149 -0
  126. package/out/core/features/generateSingle.js.map +1 -0
  127. package/out/core/features/index.d.ts +9 -0
  128. package/out/core/features/index.d.ts.map +1 -0
  129. package/out/core/features/index.js +16 -0
  130. package/out/core/features/index.js.map +1 -0
  131. package/out/core/features/lintFix.d.ts +2 -0
  132. package/out/core/features/lintFix.d.ts.map +1 -0
  133. package/out/core/features/lintFix.js +33 -0
  134. package/out/core/features/lintFix.js.map +1 -0
  135. package/out/core/features/mergeUTFile.d.ts +19 -0
  136. package/out/core/features/mergeUTFile.d.ts.map +1 -0
  137. package/out/core/features/mergeUTFile.js +63 -0
  138. package/out/core/features/mergeUTFile.js.map +1 -0
  139. package/out/core/features/removeFailedCases.d.ts +23 -0
  140. package/out/core/features/removeFailedCases.d.ts.map +1 -0
  141. package/out/core/features/removeFailedCases.js +81 -0
  142. package/out/core/features/removeFailedCases.js.map +1 -0
  143. package/out/core/features/updateSpec.d.ts +20 -0
  144. package/out/core/features/updateSpec.d.ts.map +1 -0
  145. package/out/core/features/updateSpec.js +98 -0
  146. package/out/core/features/updateSpec.js.map +1 -0
  147. package/out/core/features/validFix.d.ts +29 -0
  148. package/out/core/features/validFix.d.ts.map +1 -0
  149. package/out/core/features/validFix.js +219 -0
  150. package/out/core/features/validFix.js.map +1 -0
  151. package/out/core/generate/UTGen.d.ts +79 -0
  152. package/out/core/generate/UTGen.d.ts.map +1 -0
  153. package/out/core/generate/UTGen.js +795 -0
  154. package/out/core/generate/UTGen.js.map +1 -0
  155. package/out/core/llm/index.d.ts +9 -0
  156. package/out/core/llm/index.d.ts.map +1 -0
  157. package/out/core/llm/index.js +39 -0
  158. package/out/core/llm/index.js.map +1 -0
  159. package/out/core/llm/prompts/config.d.ts +6 -0
  160. package/out/core/llm/prompts/config.d.ts.map +1 -0
  161. package/out/core/llm/prompts/config.js +239 -0
  162. package/out/core/llm/prompts/config.js.map +1 -0
  163. package/out/core/llm/prompts/templates/common.d.ts +3 -0
  164. package/out/core/llm/prompts/templates/common.d.ts.map +1 -0
  165. package/out/core/llm/prompts/templates/common.js +27 -0
  166. package/out/core/llm/prompts/templates/common.js.map +1 -0
  167. package/out/core/llm/prompts/templates/fixCase.d.ts +4 -0
  168. package/out/core/llm/prompts/templates/fixCase.d.ts.map +1 -0
  169. package/out/core/llm/prompts/templates/fixCase.js +46 -0
  170. package/out/core/llm/prompts/templates/fixCase.js.map +1 -0
  171. package/out/core/llm/prompts/templates/fixLint.d.ts +3 -0
  172. package/out/core/llm/prompts/templates/fixLint.d.ts.map +1 -0
  173. package/out/core/llm/prompts/templates/fixLint.js +22 -0
  174. package/out/core/llm/prompts/templates/fixLint.js.map +1 -0
  175. package/out/core/llm/prompts/templates/genClassMemberUT.d.ts +5 -0
  176. package/out/core/llm/prompts/templates/genClassMemberUT.d.ts.map +1 -0
  177. package/out/core/llm/prompts/templates/genClassMemberUT.js +115 -0
  178. package/out/core/llm/prompts/templates/genClassMemberUT.js.map +1 -0
  179. package/out/core/llm/prompts/templates/genFuncUT.d.ts +4 -0
  180. package/out/core/llm/prompts/templates/genFuncUT.d.ts.map +1 -0
  181. package/out/core/llm/prompts/templates/genFuncUT.js +64 -0
  182. package/out/core/llm/prompts/templates/genFuncUT.js.map +1 -0
  183. package/out/core/llm/prompts/templates/mergeUT.d.ts +4 -0
  184. package/out/core/llm/prompts/templates/mergeUT.d.ts.map +1 -0
  185. package/out/core/llm/prompts/templates/mergeUT.js +106 -0
  186. package/out/core/llm/prompts/templates/mergeUT.js.map +1 -0
  187. package/out/core/llm/prompts/templates/msnStudio.d.ts +3 -0
  188. package/out/core/llm/prompts/templates/msnStudio.d.ts.map +1 -0
  189. package/out/core/llm/prompts/templates/msnStudio.js +36 -0
  190. package/out/core/llm/prompts/templates/msnStudio.js.map +1 -0
  191. package/out/core/llm/prompts/templates/snapshotUT.d.ts +4 -0
  192. package/out/core/llm/prompts/templates/snapshotUT.d.ts.map +1 -0
  193. package/out/core/llm/prompts/templates/snapshotUT.js +68 -0
  194. package/out/core/llm/prompts/templates/snapshotUT.js.map +1 -0
  195. package/out/core/llm/prompts/templates/updateSpecBlock.d.ts +3 -0
  196. package/out/core/llm/prompts/templates/updateSpecBlock.d.ts.map +1 -0
  197. package/out/core/llm/prompts/templates/updateSpecBlock.js +38 -0
  198. package/out/core/llm/prompts/templates/updateSpecBlock.js.map +1 -0
  199. package/out/core/llm/prompts/templates/updateSpecFile.d.ts +3 -0
  200. package/out/core/llm/prompts/templates/updateSpecFile.d.ts.map +1 -0
  201. package/out/core/llm/prompts/templates/updateSpecFile.js +30 -0
  202. package/out/core/llm/prompts/templates/updateSpecFile.js.map +1 -0
  203. package/out/core/llm/types.d.ts +80 -0
  204. package/out/core/llm/types.d.ts.map +1 -0
  205. package/out/core/llm/types.js +5 -0
  206. package/out/core/llm/types.js.map +1 -0
  207. package/out/core/quality/validateMockedTest.d.ts +3 -0
  208. package/out/core/quality/validateMockedTest.d.ts.map +1 -0
  209. package/out/core/quality/validateMockedTest.js +211 -0
  210. package/out/core/quality/validateMockedTest.js.map +1 -0
  211. package/out/core/utils/checkTestIgnore.d.ts +4 -0
  212. package/out/core/utils/checkTestIgnore.d.ts.map +1 -0
  213. package/out/core/utils/checkTestIgnore.js +52 -0
  214. package/out/core/utils/checkTestIgnore.js.map +1 -0
  215. package/out/core/utils/common.d.ts +4 -0
  216. package/out/core/utils/common.d.ts.map +1 -0
  217. package/out/core/utils/common.js +34 -0
  218. package/out/core/utils/common.js.map +1 -0
  219. package/out/core/utils/console.d.ts +8 -0
  220. package/out/core/utils/console.d.ts.map +1 -0
  221. package/out/core/utils/console.js +24 -0
  222. package/out/core/utils/console.js.map +1 -0
  223. package/out/core/utils/deps.d.ts +3 -0
  224. package/out/core/utils/deps.d.ts.map +1 -0
  225. package/out/core/utils/deps.js +58 -0
  226. package/out/core/utils/deps.js.map +1 -0
  227. package/out/core/utils/eslintRuleHandler.d.ts +3 -0
  228. package/out/core/utils/eslintRuleHandler.d.ts.map +1 -0
  229. package/out/core/utils/eslintRuleHandler.js +98 -0
  230. package/out/core/utils/eslintRuleHandler.js.map +1 -0
  231. package/out/core/utils/file.d.ts +18 -0
  232. package/out/core/utils/file.d.ts.map +1 -0
  233. package/out/core/utils/file.js +142 -0
  234. package/out/core/utils/file.js.map +1 -0
  235. package/out/core/utils/lint.d.ts +9 -0
  236. package/out/core/utils/lint.d.ts.map +1 -0
  237. package/out/core/utils/lint.js +95 -0
  238. package/out/core/utils/lint.js.map +1 -0
  239. package/out/core/utils/lru.d.ts +12 -0
  240. package/out/core/utils/lru.d.ts.map +1 -0
  241. package/out/core/utils/lru.js +47 -0
  242. package/out/core/utils/lru.js.map +1 -0
  243. package/out/core/utils/move.d.ts +12 -0
  244. package/out/core/utils/move.d.ts.map +1 -0
  245. package/out/core/utils/move.js +93 -0
  246. package/out/core/utils/move.js.map +1 -0
  247. package/out/core/utils/msnStudio.d.ts +13 -0
  248. package/out/core/utils/msnStudio.d.ts.map +1 -0
  249. package/out/core/utils/msnStudio.js +150 -0
  250. package/out/core/utils/msnStudio.js.map +1 -0
  251. package/out/core/utils/parseCustomizedCmd.d.ts +2 -0
  252. package/out/core/utils/parseCustomizedCmd.d.ts.map +1 -0
  253. package/out/core/utils/parseCustomizedCmd.js +32 -0
  254. package/out/core/utils/parseCustomizedCmd.js.map +1 -0
  255. package/out/core/utils/specBlock.d.ts +20 -0
  256. package/out/core/utils/specBlock.d.ts.map +1 -0
  257. package/out/core/utils/specBlock.js +231 -0
  258. package/out/core/utils/specBlock.js.map +1 -0
  259. package/out/core/utils/system.d.ts +13 -0
  260. package/out/core/utils/system.d.ts.map +1 -0
  261. package/out/core/utils/system.js +86 -0
  262. package/out/core/utils/system.js.map +1 -0
  263. package/out/core/utils/telemetry.d.ts +9 -0
  264. package/out/core/utils/telemetry.d.ts.map +1 -0
  265. package/out/core/utils/telemetry.js +32 -0
  266. package/out/core/utils/telemetry.js.map +1 -0
  267. package/out/core/utils/tsMorph.d.ts +13 -0
  268. package/out/core/utils/tsMorph.d.ts.map +1 -0
  269. package/out/core/utils/tsMorph.js +76 -0
  270. package/out/core/utils/tsMorph.js.map +1 -0
  271. package/out/core/valid/customizedLint.d.ts +2 -0
  272. package/out/core/valid/customizedLint.d.ts.map +1 -0
  273. package/out/core/valid/customizedLint.js +64 -0
  274. package/out/core/valid/customizedLint.js.map +1 -0
  275. package/out/core/valid/customizedTest.d.ts +3 -0
  276. package/out/core/valid/customizedTest.d.ts.map +1 -0
  277. package/out/core/valid/customizedTest.js +58 -0
  278. package/out/core/valid/customizedTest.js.map +1 -0
  279. package/out/core/valid/extractVitestConfig.d.ts +5 -0
  280. package/out/core/valid/extractVitestConfig.d.ts.map +1 -0
  281. package/out/core/valid/extractVitestConfig.js +97 -0
  282. package/out/core/valid/extractVitestConfig.js.map +1 -0
  283. package/out/core/valid/getViteConfig.d.ts +2 -0
  284. package/out/core/valid/getViteConfig.d.ts.map +1 -0
  285. package/out/core/valid/getViteConfig.js +65 -0
  286. package/out/core/valid/getViteConfig.js.map +1 -0
  287. package/out/core/valid/index.d.ts +15 -0
  288. package/out/core/valid/index.d.ts.map +1 -0
  289. package/out/core/valid/index.js +99 -0
  290. package/out/core/valid/index.js.map +1 -0
  291. package/out/core/valid/jest.d.ts +4 -0
  292. package/out/core/valid/jest.d.ts.map +1 -0
  293. package/out/core/valid/jest.js +121 -0
  294. package/out/core/valid/jest.js.map +1 -0
  295. package/out/core/valid/mock.d.ts +2 -0
  296. package/out/core/valid/mock.d.ts.map +1 -0
  297. package/out/core/valid/mock.js +149 -0
  298. package/out/core/valid/mock.js.map +1 -0
  299. package/out/core/valid/remove.d.ts +5 -0
  300. package/out/core/valid/remove.d.ts.map +1 -0
  301. package/out/core/valid/remove.js +109 -0
  302. package/out/core/valid/remove.js.map +1 -0
  303. package/out/core/valid/tag.d.ts +3 -0
  304. package/out/core/valid/tag.d.ts.map +1 -0
  305. package/out/core/valid/tag.js +91 -0
  306. package/out/core/valid/tag.js.map +1 -0
  307. package/out/core/valid/type.d.ts +83 -0
  308. package/out/core/valid/type.d.ts.map +1 -0
  309. package/out/core/valid/type.js +3 -0
  310. package/out/core/valid/type.js.map +1 -0
  311. package/out/core/valid/vitest.d.ts +3 -0
  312. package/out/core/valid/vitest.d.ts.map +1 -0
  313. package/out/core/valid/vitest.js +82 -0
  314. package/out/core/valid/vitest.js.map +1 -0
  315. package/out/index.d.ts +20 -0
  316. package/out/index.d.ts.map +1 -0
  317. package/out/index.js +60 -0
  318. package/out/index.js.map +1 -0
  319. package/out/setup.d.ts +11 -0
  320. package/out/setup.d.ts.map +1 -0
  321. package/out/setup.js +14 -0
  322. package/out/setup.js.map +1 -0
  323. package/out/types.d.ts +23 -0
  324. package/out/types.d.ts.map +1 -0
  325. package/out/types.js +3 -0
  326. package/out/types.js.map +1 -0
  327. package/package.json +39 -0
  328. package/package_devops.json +42 -0
package/README.md ADDED
@@ -0,0 +1,6 @@
1
+ # Setup
2
+
3
+ ```bash
4
+ $ npm run setup-npm-auth
5
+ $ npm i
6
+ ```
@@ -0,0 +1,51 @@
1
+ # trigger:
2
+ # - main # branch
3
+
4
+ trigger: none
5
+ pr: none
6
+
7
+ pool:
8
+ vmImage: 'ubuntu-latest'
9
+
10
+ variables:
11
+ workingDir: 'msnews-ut-copilot'
12
+
13
+ steps:
14
+ - task: NodeTool@0
15
+ inputs:
16
+ versionSpec: '18.x'
17
+ displayName: 'Install Node.js'
18
+
19
+ # Auth Azure Artifacts Feed using .npmrc
20
+ - task: npmAuthenticate@0
21
+ inputs:
22
+ workingFile: '$(workingDir)/.npmrc'
23
+ displayName: 'Authenticate with Azure Artifacts'
24
+
25
+ # install package, build and pack
26
+ - script: |
27
+ cd $(workingDir)
28
+ echo "================ Installing common dependencies ================"
29
+ npm install
30
+ cd ./test-copilot-core
31
+ echo "================ Building test-copilot-core ================"
32
+ npm install --userconfig=../.npmrc
33
+ npm run build
34
+ npm pack
35
+ displayName: 'Install and Pack NPM Package'
36
+
37
+ # publish to Azure Artifacts npm feed
38
+ # - script: |
39
+ # cd $(workingDir)
40
+ # npm publish --registry https://pkgs.dev.azure.com/msasg/ContentServices/_packaging/MSNews/npm/registry
41
+ # displayName: 'Publish to Azure Artifacts'
42
+
43
+ - task: Npm@1
44
+ inputs:
45
+ command: publish
46
+ publishRegistry: useFeed
47
+ publishFeed: ContentServices/MSNews
48
+ workingDir: '$(workingDir)/test-copilot-core'
49
+ # condition: and(succeeded(), in(variables['commitType'], 'feat', 'fix', 'chore', 'prerelease'))
50
+ continueOnError: true
51
+ displayName: Publish
@@ -0,0 +1,7 @@
1
+ export declare function sendTelemetryEvent(eventName: string, properties?: {
2
+ [key: string]: string;
3
+ }, measurements?: {
4
+ [key: string]: number;
5
+ }): void;
6
+ export declare function sendUserUsageEvent(customUserName?: string, source?: string): void;
7
+ //# sourceMappingURL=appInsightTelemetry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appInsightTelemetry.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/appInsightTelemetry.ts"],"names":[],"mappings":"AA2BA,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EAAE,YAAY,CAAC,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,QAQrI;AAED,wBAAgB,kBAAkB,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,QAM1E"}
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.sendTelemetryEvent = sendTelemetryEvent;
37
+ exports.sendUserUsageEvent = sendUserUsageEvent;
38
+ const appInsights = __importStar(require("applicationinsights"));
39
+ const telemetry_1 = require("../../core/utils/telemetry");
40
+ const system_1 = require("../../core/utils/system");
41
+ const os_1 = require("os");
42
+ const connectionString = "InstrumentationKey=c1a0c6a2-06a6-405f-9343-c8fbe29e0dc2;IngestionEndpoint=https://eastus2-3.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus2.livediagnostics.monitor.azure.com/;ApplicationId=e90435ce-8771-4069-bc94-77aaf8099529";
43
+ // init Application Insights
44
+ appInsights.setup(connectionString)
45
+ .setAutoCollectConsole(false)
46
+ .setAutoCollectDependencies(false)
47
+ .setAutoCollectExceptions(false)
48
+ .setAutoCollectPerformance(false)
49
+ .setAutoCollectRequests(false)
50
+ .setUseDiskRetryCaching(false)
51
+ .start();
52
+ let userId;
53
+ function initUser() {
54
+ if (userId) {
55
+ return;
56
+ }
57
+ userId = (0, system_1.getMachineId)();
58
+ appInsights.defaultClient.context.tags[appInsights.defaultClient.context.keys.userId] = userId;
59
+ }
60
+ function sendTelemetryEvent(eventName, properties, measurements) {
61
+ initUser();
62
+ appInsights.defaultClient.trackEvent({
63
+ name: eventName,
64
+ properties: (0, telemetry_1.formatEventProps)(properties, properties?.source),
65
+ measurements
66
+ });
67
+ appInsights.defaultClient.flush();
68
+ }
69
+ function sendUserUsageEvent(customUserName, source) {
70
+ const userName = customUserName || (0, os_1.userInfo)()?.username;
71
+ sendTelemetryEvent("userUsage", {
72
+ "user": userName,
73
+ "source": source
74
+ });
75
+ }
76
+ //# sourceMappingURL=appInsightTelemetry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appInsightTelemetry.js","sourceRoot":"","sources":["../../../src/cli/commands/appInsightTelemetry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,gDAQC;AAED,gDAMC;AA3CD,iEAAmD;AAEnD,0DAA8D;AAC9D,oDAAuD;AACvD,2BAA8B;AAE9B,MAAM,gBAAgB,GAAG,kPAAkP,CAAC;AAE5Q,4BAA4B;AAC5B,WAAW,CAAC,KAAK,CAAC,gBAAgB,CAAC;KAC9B,qBAAqB,CAAC,KAAK,CAAC;KAC5B,0BAA0B,CAAC,KAAK,CAAC;KACjC,wBAAwB,CAAC,KAAK,CAAC;KAC/B,yBAAyB,CAAC,KAAK,CAAC;KAChC,sBAAsB,CAAC,KAAK,CAAC;KAC7B,sBAAsB,CAAC,KAAK,CAAC;KAC7B,KAAK,EAAE,CAAC;AAEb,IAAI,MAAc,CAAC;AACnB,SAAS,QAAQ;IACb,IAAI,MAAM,EAAE,CAAC;QACT,OAAO;IACX,CAAC;IACD,MAAM,GAAG,IAAA,qBAAY,GAAE,CAAC;IACxB,WAAW,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AACnG,CAAC;AAED,SAAgB,kBAAkB,CAAC,SAAiB,EAAE,UAAsC,EAAE,YAAwC;IAClI,QAAQ,EAAE,CAAC;IACX,WAAW,CAAC,aAAa,CAAC,UAAU,CAAC;QACjC,IAAI,EAAE,SAAS;QACf,UAAU,EAAE,IAAA,4BAAgB,EAAC,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC;QAC5D,YAAY;KACf,CAAC,CAAC;IACH,WAAW,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;AACtC,CAAC;AAED,SAAgB,kBAAkB,CAAC,cAAuB,EAAE,MAAe;IACvE,MAAM,QAAQ,GAAG,cAAc,IAAI,IAAA,aAAQ,GAAE,EAAE,QAAQ,CAAC;IACxD,kBAAkB,CAAC,WAAW,EAAE;QAC5B,MAAM,EAAE,QAAQ;QAChB,QAAQ,EAAE,MAAM;KACnB,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { CliConfig } from "../type";
2
+ export declare function readConfig(filePath: string): CliConfig | undefined;
3
+ export declare function initConfigFile(inputPath: string): void;
4
+ //# sourceMappingURL=cliConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cliConfig.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/cliConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAc,MAAM,SAAS,CAAC;AAIhD,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CA6BlE;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,QA0B/C"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.readConfig = readConfig;
7
+ exports.initConfigFile = initConfigFile;
8
+ const path_1 = __importDefault(require("path"));
9
+ const fs_1 = __importDefault(require("fs"));
10
+ const constants_1 = require("../../core/constants");
11
+ const config_1 = require("../../core/llm/prompts/config");
12
+ function readConfig(filePath) {
13
+ if (!filePath) {
14
+ return {
15
+ common: {
16
+ ignoreFuncs: new Set([])
17
+ },
18
+ };
19
+ }
20
+ try {
21
+ const configFilePath = path_1.default.resolve(filePath);
22
+ const { common, customizePrompt, ...other } = require(configFilePath);
23
+ const res = {
24
+ ...other,
25
+ common: {
26
+ ...common,
27
+ ignoreFuncs: new Set(common?.ignoreFuncs || [])
28
+ },
29
+ };
30
+ if (customizePrompt) {
31
+ const configFileDir = path_1.default.dirname(configFilePath);
32
+ res.promptConfigs = (0, config_1.getCustomizePrompt)(configFileDir, customizePrompt, constants_1.TEST_COPILOT_CONFIG_PROMPTS_UT_TS);
33
+ }
34
+ return res;
35
+ }
36
+ catch (error) {
37
+ console.error(`Error reading configuration file: ${filePath}`);
38
+ console.error(error);
39
+ process.exit(1);
40
+ }
41
+ }
42
+ function initConfigFile(inputPath) {
43
+ let outPath = path_1.default.resolve(inputPath || '.');
44
+ if (!outPath.endsWith('.json') || !outPath.endsWith('.js')) {
45
+ outPath = path_1.default.join(outPath, 'test-copilot-config.js');
46
+ }
47
+ const dirName = path_1.default.dirname(outPath);
48
+ if (!fs_1.default.existsSync(dirName)) {
49
+ fs_1.default.mkdirSync(dirName, { recursive: true });
50
+ }
51
+ const content = `module.exports = {
52
+ // customizePrompt: true, // or path to the prompt folder; true means to look up \`${constants_1.TEST_COPILOT_CONFIG_PROMPTS_UT_TS}\` folder
53
+ common: {
54
+ // createIndexSpec: true, // default: false; whether to create index.spec.ts file
55
+ // removeFailedCases: false, // default: true; remove failed cases from the test file instead of commenting them out
56
+ // ignoreFuncs: [], // default: []; function names to ignore when generating tests
57
+ // retryCount: 3, // default: 0; number of retries for failed tests
58
+ // saveFailed: true, // default: false; save failed tests to a separate file
59
+ // mockDependencies: {}, // TBD
60
+ },
61
+ // gpt: {
62
+ // api: "" // URL
63
+ // }
64
+ };`;
65
+ fs_1.default.writeFileSync(outPath, content, 'utf8');
66
+ console.log(`Config file created at: ${outPath}`);
67
+ }
68
+ //# sourceMappingURL=cliConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cliConfig.js","sourceRoot":"","sources":["../../../src/cli/commands/cliConfig.ts"],"names":[],"mappings":";;;;;AAMA,gCA6BC;AAED,wCA0BC;AA/DD,gDAAwB;AACxB,4CAAoB;AAEpB,oDAAyE;AACzE,0DAAmE;AAEnE,SAAgB,UAAU,CAAC,QAAgB;IACvC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,OAAO;YACH,MAAM,EAAE;gBACJ,WAAW,EAAE,IAAI,GAAG,CAAC,EAAE,CAAC;aAC3B;SACJ,CAAA;IACL,CAAC;IACD,IAAI,CAAC;QACD,MAAM,cAAc,GAAG,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC9C,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC,cAAc,CAAe,CAAC;QACpF,MAAM,GAAG,GAAc;YACnB,GAAG,KAAK;YACR,MAAM,EAAE;gBACJ,GAAG,MAAM;gBACT,WAAW,EAAE,IAAI,GAAG,CAAC,MAAM,EAAE,WAAW,IAAI,EAAE,CAAC;aAClD;SACJ,CAAC;QACF,IAAI,eAAe,EAAE,CAAC;YAClB,MAAM,aAAa,GAAG,cAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;YACnD,GAAG,CAAC,aAAa,GAAG,IAAA,2BAAkB,EAAC,aAAa,EAAE,eAAe,EAAE,6CAAiC,CAAC,CAAC;QAC9G,CAAC;QAED,OAAO,GAAG,CAAC;IACf,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,qCAAqC,QAAQ,EAAE,CAAC,CAAC;QAC/D,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACL,CAAC;AAED,SAAgB,cAAc,CAAC,SAAiB;IAC5C,IAAI,OAAO,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,IAAI,GAAG,CAAC,CAAC;IAC7C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACzD,OAAO,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,wBAAwB,CAAC,CAAC;IAC3D,CAAC;IACD,MAAM,OAAO,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACtC,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1B,YAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/C,CAAC;IACD,MAAM,OAAO,GAAG;yFACqE,6CAAiC;;;;;;;;;;;;GAYvH,CAAA;IAEC,YAAE,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC3C,OAAO,CAAC,GAAG,CAAC,2BAA2B,OAAO,EAAE,CAAC,CAAC;AACtD,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Expose the prompt template to the output directory.
3
+ * @param outPath Absolute path to the output directory
4
+ */
5
+ export declare function exposePrompt(outPath: string): void;
6
+ //# sourceMappingURL=prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/prompt.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,QAc3C"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.exposePrompt = exposePrompt;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const config_1 = require("../../core/llm/prompts/config");
9
+ /**
10
+ * Expose the prompt template to the output directory.
11
+ * @param outPath Absolute path to the output directory
12
+ */
13
+ function exposePrompt(outPath) {
14
+ try {
15
+ if (!fs_1.default.existsSync(outPath)) {
16
+ fs_1.default.mkdirSync(outPath, { recursive: true });
17
+ }
18
+ else if (!fs_1.default.statSync(outPath).isDirectory()) {
19
+ console.error(`Output path ${outPath} is not a directory.`);
20
+ return;
21
+ }
22
+ (0, config_1.promptsToFiles)(outPath);
23
+ }
24
+ catch (error) {
25
+ console.error(`Error creating output directory: ${outPath}`);
26
+ console.error(error);
27
+ }
28
+ }
29
+ //# sourceMappingURL=prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../src/cli/commands/prompt.ts"],"names":[],"mappings":";;;;;AAOA,oCAcC;AArBD,4CAAoB;AACpB,0DAA+D;AAE/D;;;GAGG;AACH,SAAgB,YAAY,CAAC,OAAe;IACxC,IAAI,CAAC;QACD,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YAC1B,YAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/C,CAAC;aAAM,IAAI,CAAC,YAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;YAC7C,OAAO,CAAC,KAAK,CAAC,eAAe,OAAO,sBAAsB,CAAC,CAAC;YAC5D,OAAO;QACX,CAAC;QAED,IAAA,uBAAc,EAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,oCAAoC,OAAO,EAAE,CAAC,CAAC;QAC7D,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;AACL,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { CliConfig } from "../type";
2
+ export declare function runUT(params: {
3
+ userName?: string;
4
+ config?: CliConfig;
5
+ target: string;
6
+ line?: number;
7
+ runTest?: boolean;
8
+ repair?: boolean;
9
+ methods?: Set<string>;
10
+ lineRanges?: number[][];
11
+ source?: string;
12
+ skipFileLevelCheck?: number;
13
+ }): Promise<void>;
14
+ //# sourceMappingURL=ut.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ut.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/ut.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAOpC,wBAAsB,KAAK,CAAC,MAAM,EAAE;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B,iBA+DA"}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.runUT = runUT;
7
+ const UTGen_1 = require("../../core/generate/UTGen");
8
+ const appInsightTelemetry_1 = require("./appInsightTelemetry");
9
+ const fs_1 = __importDefault(require("fs"));
10
+ const gpt_1 = require("../utils/gpt");
11
+ const file_1 = require("../../core/utils/file");
12
+ const path_1 = __importDefault(require("path"));
13
+ const setup_1 = require("../../setup");
14
+ async function runUT(params) {
15
+ const { userName, config, target, line, runTest, repair, methods, lineRanges, source, skipFileLevelCheck } = params;
16
+ (0, appInsightTelemetry_1.sendUserUsageEvent)(userName, source);
17
+ (0, setup_1.setup)({
18
+ getConfig: () => ({
19
+ ...config
20
+ }),
21
+ getLLMResponse: gpt_1.getGPTResponse,
22
+ sendTelemetry: appInsightTelemetry_1.sendTelemetryEvent
23
+ });
24
+ const targetPath = path_1.default.resolve(target);
25
+ if (!fs_1.default.existsSync(targetPath)) {
26
+ console.error(`Target file or directory does not exist: ${target}`);
27
+ return;
28
+ }
29
+ const packages = (0, file_1.getPackagesFrom)(targetPath);
30
+ const genOptions = {
31
+ progress: ({ message }) => { message && console.log(message); },
32
+ };
33
+ if (line) {
34
+ genOptions.selectedLine = line;
35
+ }
36
+ if (methods) {
37
+ genOptions.methods = methods;
38
+ }
39
+ if (lineRanges) {
40
+ genOptions.lineRanges = lineRanges;
41
+ }
42
+ if (runTest) {
43
+ genOptions.runTest = runTest;
44
+ }
45
+ if (repair) {
46
+ genOptions.repair = repair;
47
+ }
48
+ if (config.promptConfigs) {
49
+ genOptions.promptConfigs = config.promptConfigs;
50
+ }
51
+ genOptions.skipFileLevelCheck = skipFileLevelCheck === 1;
52
+ const currentPath = path_1.default.resolve('.');
53
+ console.log(`Found ${packages.length} packages to generate unit tests.`);
54
+ console.log(JSON.stringify(packages, null, 4));
55
+ for (let i = 0; i < packages.length; i++) {
56
+ const root = packages[i].packagePath;
57
+ const files = packages[i].targetFiles;
58
+ console.log(`Found ${files.length} files to generate unit tests:`);
59
+ for (let j = 0; j < files.length; j++) {
60
+ console.log('to: ', files[j]);
61
+ const file = files[j];
62
+ const relativePath = path_1.default.relative(currentPath, file);
63
+ console.log(`(${j + 1}/${files.length}) Generating unit test for ${relativePath}`);
64
+ const gen = new UTGen_1.UTGen(file, root, genOptions);
65
+ await gen.run();
66
+ console.log(`Unit test generation completed for ${relativePath}`);
67
+ console.log(`\t${gen.count.success} tests generated, ${gen.count.classMemberFailed + gen.count.funFailed} tests failed`);
68
+ console.log('---------------------------------------------------');
69
+ }
70
+ }
71
+ }
72
+ //# sourceMappingURL=ut.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ut.js","sourceRoot":"","sources":["../../../src/cli/commands/ut.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,18 @@
1
+ export declare function runUTCmd(params: {
2
+ userName?: string;
3
+ source: string;
4
+ sourceMeta: string;
5
+ mode?: string;
6
+ type?: string;
7
+ code?: string;
8
+ keepFailedTestFile?: number;
9
+ removeFailedTestCases?: number;
10
+ skipFileLevelCheck?: number;
11
+ enableCov?: number;
12
+ LLMModel?: string;
13
+ LLMAuthKey?: string;
14
+ testDirRelativeToPackage?: string;
15
+ customizedTestCmd?: string;
16
+ customizedLintCmd?: string;
17
+ }): Promise<void>;
18
+ //# sourceMappingURL=utPipeCmdWrapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utPipeCmdWrapper.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/utPipeCmdWrapper.ts"],"names":[],"mappings":"AAMA,wBAAsB,QAAQ,CAAC,MAAM,EAAE;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B,iBA8BA"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runUTCmd = runUTCmd;
4
+ const config_1 = require("../config");
5
+ const ut_1 = require("./ut");
6
+ // run ut from cmd call
7
+ async function runUTCmd(params) {
8
+ const { sourceMeta, mode, keepFailedTestFile, removeFailedTestCases, userName, source, skipFileLevelCheck, testDirRelativeToPackage, customizedTestCmd, customizedLintCmd } = params;
9
+ const isRepair = mode == config_1.Mode.Repair;
10
+ const cliConfig = {
11
+ common: {
12
+ saveFailed: keepFailedTestFile === 1,
13
+ removeFailedCases: removeFailedTestCases === 1,
14
+ testDirRelativeToPackage: testDirRelativeToPackage,
15
+ customizedTestCmd: customizedTestCmd,
16
+ customizedLintCmd: customizedLintCmd
17
+ },
18
+ promptConfigs: {}
19
+ };
20
+ const sourceMetas = JSON.parse(sourceMeta);
21
+ for (const sourceMeta of sourceMetas) {
22
+ const sourcePath = sourceMeta.codePath;
23
+ const verifyTests = sourceMeta.verifyTests === 1;
24
+ (0, ut_1.runUT)({
25
+ userName,
26
+ config: cliConfig,
27
+ target: sourcePath,
28
+ runTest: verifyTests,
29
+ repair: isRepair,
30
+ methods: new Set(sourceMeta.methods),
31
+ lineRanges: sourceMeta.lineRanges,
32
+ source: source,
33
+ skipFileLevelCheck: skipFileLevelCheck
34
+ });
35
+ }
36
+ }
37
+ //# sourceMappingURL=utPipeCmdWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utPipeCmdWrapper.js","sourceRoot":"","sources":["../../../src/cli/commands/utPipeCmdWrapper.ts"],"names":[],"mappings":";;AAMA,4BA8CC;AApDD,sCAAmD;AAGnD,6BAA6B;AAE7B,uBAAuB;AAChB,KAAK,UAAU,QAAQ,CAAC,MAgB9B;IACG,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,kBAAkB,EAAE,qBAAqB,EAAC,QAAQ,EAAE,MAAM,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAAC;IAEpL,MAAM,QAAQ,GAAG,IAAI,IAAI,aAAI,CAAC,MAAM,CAAC;IACrC,MAAM,SAAS,GAAc;QACzB,MAAM,EAAE;YACJ,UAAU,EAAE,kBAAkB,KAAK,CAAC;YACpC,iBAAiB,EAAE,qBAAqB,KAAK,CAAC;YAC9C,wBAAwB,EAAE,wBAAwB;YAClD,iBAAiB,EAAE,iBAAiB;YACpC,iBAAiB,EAAE,iBAAiB;SACvC;QACD,aAAa,EAAE,EAAE;KACpB,CAAC;IACF,MAAM,WAAW,GAAuB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAC/D,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACnC,MAAM,UAAU,GAAG,UAAU,CAAC,QAAQ,CAAC;QACvC,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,KAAK,CAAC,CAAC;QACjD,IAAA,UAAK,EAAC;YACF,QAAQ;YACR,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,UAAU;YAClB,OAAO,EAAE,WAAW;YACpB,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE,IAAI,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC;YACpC,UAAU,EAAE,UAAU,CAAC,UAAU;YACjC,MAAM,EAAE,MAAM;YACd,kBAAkB,EAAE,kBAAkB;SACzC,CAAC,CAAC;IACP,CAAC;AACL,CAAC"}
@@ -0,0 +1,15 @@
1
+ export interface SourceMetaConfig {
2
+ codePath: string;
3
+ exclude?: Set<string>;
4
+ methods?: string[];
5
+ lineRanges?: number[][];
6
+ testCodePath?: string;
7
+ prompt?: string;
8
+ covPath?: string;
9
+ verifyTests?: number;
10
+ }
11
+ export declare enum Mode {
12
+ Generate = "generate",
13
+ Repair = "repair"
14
+ }
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/config/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,oBAAY,IAAI;IACZ,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Mode = void 0;
4
+ var Mode;
5
+ (function (Mode) {
6
+ Mode["Generate"] = "generate";
7
+ Mode["Repair"] = "repair";
8
+ })(Mode || (exports.Mode = Mode = {}));
9
+ ;
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/config/index.ts"],"names":[],"mappings":";;;AAWA,IAAY,IAGT;AAHH,WAAY,IAAI;IACZ,6BAAqB,CAAA;IACrB,yBAAiB,CAAA;AACnB,CAAC,EAHS,IAAI,oBAAJ,IAAI,QAGb;AAAA,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":""}