sxy-test-runner 1.4.4 → 2.0.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 (287) hide show
  1. package/dist/cli/index.js +24 -22
  2. package/dist/cli/init.js +41 -91
  3. package/dist/cli/init.js.map +1 -1
  4. package/dist/cli/lib/addBasePath.d.ts.map +1 -1
  5. package/dist/cli/lib/addBasePath.js +12 -14
  6. package/dist/cli/lib/addBasePath.js.map +1 -1
  7. package/dist/cli/lib/addBasePath.unitTest.d.ts +2 -0
  8. package/dist/cli/lib/addBasePath.unitTest.d.ts.map +1 -0
  9. package/dist/cli/lib/addBasePath.unitTest.js +51 -29
  10. package/dist/cli/lib/addBasePath.unitTest.js.map +1 -0
  11. package/dist/cli/lib/addExports.js +13 -11
  12. package/dist/cli/lib/addExports.unitTest.d.ts +2 -0
  13. package/dist/cli/lib/addExports.unitTest.d.ts.map +1 -0
  14. package/dist/cli/lib/addExports.unitTest.js +15 -30
  15. package/dist/cli/lib/addExports.unitTest.js.map +1 -0
  16. package/dist/cli/lib/applyConfigDefaults.js +6 -42
  17. package/dist/cli/lib/applyConfigDefaults.js.map +1 -1
  18. package/dist/cli/lib/applyConfigDefaults.unitTest.d.ts +2 -0
  19. package/dist/cli/lib/applyConfigDefaults.unitTest.d.ts.map +1 -0
  20. package/dist/cli/lib/applyConfigDefaults.unitTest.js +19 -27
  21. package/dist/cli/lib/applyConfigDefaults.unitTest.js.map +1 -0
  22. package/dist/cli/lib/buildDependencyTree.js +23 -34
  23. package/dist/cli/lib/buildDependencyTree.js.map +1 -1
  24. package/dist/cli/lib/buildDependencyTree.unitTest.d.ts +2 -0
  25. package/dist/cli/lib/buildDependencyTree.unitTest.d.ts.map +1 -0
  26. package/dist/cli/lib/buildDependencyTree.unitTest.js +13 -11
  27. package/dist/cli/lib/buildDependencyTree.unitTest.js.map +1 -0
  28. package/dist/cli/lib/buildDependencyTrees.js +15 -34
  29. package/dist/cli/lib/buildDependencyTrees.js.map +1 -1
  30. package/dist/cli/lib/buildDependencyTrees.unitTest.d.ts +2 -0
  31. package/dist/cli/lib/buildDependencyTrees.unitTest.d.ts.map +1 -0
  32. package/dist/cli/lib/buildDependencyTrees.unitTest.js +18 -14
  33. package/dist/cli/lib/buildDependencyTrees.unitTest.js.map +1 -0
  34. package/dist/cli/lib/defaultConfig.js +23 -21
  35. package/dist/cli/lib/defaultConfig.unitTest.d.ts +2 -0
  36. package/dist/cli/lib/defaultConfig.unitTest.d.ts.map +1 -0
  37. package/dist/cli/lib/defaultConfig.unitTest.js +7 -0
  38. package/dist/cli/lib/defaultConfig.unitTest.js.map +1 -0
  39. package/dist/cli/lib/doUserSetup.d.ts +1 -1
  40. package/dist/cli/lib/doUserSetup.d.ts.map +1 -1
  41. package/dist/cli/lib/doUserSetup.js +20 -23
  42. package/dist/cli/lib/doUserSetup.js.map +1 -1
  43. package/dist/cli/lib/doUserSetup.unitTest.d.ts +7 -0
  44. package/dist/cli/lib/doUserSetup.unitTest.d.ts.map +1 -0
  45. package/dist/cli/lib/doUserSetup.unitTest.js +41 -36
  46. package/dist/cli/lib/doUserSetup.unitTest.js.map +1 -0
  47. package/dist/cli/lib/doUserTeardown.d.ts +1 -1
  48. package/dist/cli/lib/doUserTeardown.d.ts.map +1 -1
  49. package/dist/cli/lib/doUserTeardown.js +21 -23
  50. package/dist/cli/lib/doUserTeardown.js.map +1 -1
  51. package/dist/cli/lib/doUserTeardown.unitTest.d.ts +7 -0
  52. package/dist/cli/lib/doUserTeardown.unitTest.d.ts.map +1 -0
  53. package/dist/cli/lib/doUserTeardown.unitTest.js +41 -36
  54. package/dist/cli/lib/doUserTeardown.unitTest.js.map +1 -0
  55. package/dist/cli/lib/findTestFiles.d.ts.map +1 -1
  56. package/dist/cli/lib/findTestFiles.js +16 -24
  57. package/dist/cli/lib/findTestFiles.js.map +1 -1
  58. package/dist/cli/lib/findTestFiles.unitTest.d.ts +2 -0
  59. package/dist/cli/lib/findTestFiles.unitTest.d.ts.map +1 -0
  60. package/dist/cli/lib/findTestFiles.unitTest.js +19 -19
  61. package/dist/cli/lib/findTestFiles.unitTest.js.map +1 -0
  62. package/dist/cli/lib/getAllowedFlags.js +10 -8
  63. package/dist/cli/lib/getAllowedFlags.unitTest.d.ts +2 -0
  64. package/dist/cli/lib/getAllowedFlags.unitTest.d.ts.map +1 -0
  65. package/dist/cli/lib/getAllowedFlags.unitTest.js +22 -21
  66. package/dist/cli/lib/getAllowedFlags.unitTest.js.map +1 -0
  67. package/dist/cli/lib/globArgCombine.js +8 -1
  68. package/dist/cli/lib/globArgCombine.unitTest.d.ts +2 -0
  69. package/dist/cli/lib/globArgCombine.unitTest.d.ts.map +1 -0
  70. package/dist/cli/lib/globArgCombine.unitTest.js +19 -18
  71. package/dist/cli/lib/globArgCombine.unitTest.js.map +1 -0
  72. package/dist/cli/lib/injectProperties.d.ts.map +1 -1
  73. package/dist/cli/lib/injectProperties.js +10 -10
  74. package/dist/cli/lib/injectProperties.js.map +1 -1
  75. package/dist/cli/lib/injectProperties.unitTest.d.ts +2 -0
  76. package/dist/cli/lib/injectProperties.unitTest.d.ts.map +1 -0
  77. package/dist/cli/lib/injectProperties.unitTest.js +19 -81
  78. package/dist/cli/lib/injectProperties.unitTest.js.map +1 -0
  79. package/dist/cli/lib/loadConfig.js +14 -18
  80. package/dist/cli/lib/loadConfig.js.map +1 -1
  81. package/dist/cli/lib/loadConfig.unitTest.d.ts +2 -0
  82. package/dist/cli/lib/loadConfig.unitTest.d.ts.map +1 -0
  83. package/dist/cli/lib/loadConfig.unitTest.js +15 -15
  84. package/dist/cli/lib/loadConfig.unitTest.js.map +1 -0
  85. package/dist/cli/lib/loadTestFile.js +48 -78
  86. package/dist/cli/lib/loadTestFile.js.map +1 -1
  87. package/dist/cli/lib/loadTestFile.unitTest.d.ts +2 -0
  88. package/dist/cli/lib/loadTestFile.unitTest.d.ts.map +1 -0
  89. package/dist/cli/lib/loadTestFile.unitTest.js +12 -49
  90. package/dist/cli/lib/loadTestFile.unitTest.js.map +1 -0
  91. package/dist/cli/lib/parseCommandLineArguments.js +48 -42
  92. package/dist/cli/lib/parseCommandLineArguments.unitTest.d.ts +2 -0
  93. package/dist/cli/lib/parseCommandLineArguments.unitTest.d.ts.map +1 -0
  94. package/dist/cli/lib/parseCommandLineArguments.unitTest.js +22 -24
  95. package/dist/cli/lib/parseCommandLineArguments.unitTest.js.map +1 -0
  96. package/dist/cli/lib/parseDescribe.d.ts.map +1 -1
  97. package/dist/cli/lib/parseDescribe.js +67 -81
  98. package/dist/cli/lib/parseDescribe.js.map +1 -1
  99. package/dist/cli/lib/parseDescribe.unitTest.d.ts +2 -0
  100. package/dist/cli/lib/parseDescribe.unitTest.d.ts.map +1 -0
  101. package/dist/cli/lib/parseDescribe.unitTest.js +20 -18
  102. package/dist/cli/lib/parseDescribe.unitTest.js.map +1 -0
  103. package/dist/cli/lib/reservedExportKeys.d.ts +2 -0
  104. package/dist/cli/lib/reservedExportKeys.d.ts.map +1 -0
  105. package/dist/cli/lib/reservedExportKeys.js +12 -1
  106. package/dist/cli/lib/reservedExportKeys.js.map +1 -0
  107. package/dist/cli/lib/reservedExportKeys.unitTest.d.ts +2 -0
  108. package/dist/cli/lib/reservedExportKeys.unitTest.d.ts.map +1 -0
  109. package/dist/cli/lib/reservedExportKeys.unitTest.js +6 -8
  110. package/dist/cli/lib/reservedExportKeys.unitTest.js.map +1 -0
  111. package/dist/cli/lib/runDescribe.d.ts.map +1 -1
  112. package/dist/cli/lib/runDescribe.js +39 -39
  113. package/dist/cli/lib/runDescribe.js.map +1 -1
  114. package/dist/cli/lib/runDescribe.unitTest.d.ts +2 -0
  115. package/dist/cli/lib/runDescribe.unitTest.d.ts.map +1 -0
  116. package/dist/cli/lib/runDescribe.unitTest.js +22 -402
  117. package/dist/cli/lib/runDescribe.unitTest.js.map +1 -0
  118. package/dist/cli/lib/runDescribeRun.js +34 -49
  119. package/dist/cli/lib/runDescribeRun.js.map +1 -1
  120. package/dist/cli/lib/runDescribeRun.unitTest.d.ts +2 -0
  121. package/dist/cli/lib/runDescribeRun.unitTest.d.ts.map +1 -0
  122. package/dist/cli/lib/runDescribeRun.unitTest.js +44 -410
  123. package/dist/cli/lib/runDescribeRun.unitTest.js.map +1 -0
  124. package/dist/cli/lib/runIt.d.ts +1 -1
  125. package/dist/cli/lib/runIt.d.ts.map +1 -1
  126. package/dist/cli/lib/runIt.js +59 -69
  127. package/dist/cli/lib/runIt.js.map +1 -1
  128. package/dist/cli/lib/runIt.unitTest.d.ts +2 -0
  129. package/dist/cli/lib/runIt.unitTest.d.ts.map +1 -0
  130. package/dist/cli/lib/runIt.unitTest.js +73 -410
  131. package/dist/cli/lib/runIt.unitTest.js.map +1 -0
  132. package/dist/cli/lib/runTasks.d.ts +1 -1
  133. package/dist/cli/lib/runTasks.d.ts.map +1 -1
  134. package/dist/cli/lib/runTasks.js +28 -31
  135. package/dist/cli/lib/runTasks.js.map +1 -1
  136. package/dist/cli/lib/runTasks.unitTest.d.ts +5 -0
  137. package/dist/cli/lib/runTasks.unitTest.d.ts.map +1 -0
  138. package/dist/cli/lib/runTasks.unitTest.js +35 -31
  139. package/dist/cli/lib/runTasks.unitTest.js.map +1 -0
  140. package/dist/cli/lib/runTest.js +54 -66
  141. package/dist/cli/lib/runTest.js.map +1 -1
  142. package/dist/cli/lib/runTest.unitTest.d.ts +20 -0
  143. package/dist/cli/lib/runTest.unitTest.d.ts.map +1 -0
  144. package/dist/cli/lib/runTest.unitTest.js +274 -289
  145. package/dist/cli/lib/runTest.unitTest.js.map +1 -0
  146. package/dist/cli/lib/runTests.d.ts.map +1 -1
  147. package/dist/cli/lib/runTests.js +123 -141
  148. package/dist/cli/lib/runTests.js.map +1 -1
  149. package/dist/cli/lib/runTests.unitTest.d.ts +6 -0
  150. package/dist/cli/lib/runTests.unitTest.d.ts.map +1 -0
  151. package/dist/cli/lib/runTests.unitTest.js +48 -61
  152. package/dist/cli/lib/runTests.unitTest.js.map +1 -0
  153. package/dist/cli/lib/showTestLoadingError.js +22 -33
  154. package/dist/cli/lib/showTestLoadingError.js.map +1 -1
  155. package/dist/cli/lib/showTestLoadingError.unitTest.d.ts +2 -0
  156. package/dist/cli/lib/showTestLoadingError.unitTest.d.ts.map +1 -0
  157. package/dist/cli/lib/showTestLoadingError.unitTest.js +16 -24
  158. package/dist/cli/lib/showTestLoadingError.unitTest.js.map +1 -0
  159. package/dist/cli/lib/showTestResult.js +88 -88
  160. package/dist/cli/lib/showTestResult.js.map +1 -1
  161. package/dist/cli/lib/showTestResult.unitTest.d.ts +2 -0
  162. package/dist/cli/lib/showTestResult.unitTest.d.ts.map +1 -0
  163. package/dist/cli/lib/showTestResult.unitTest.js +176 -184
  164. package/dist/cli/lib/showTestResult.unitTest.js.map +1 -0
  165. package/dist/cli/lib/testHelpers/makeCustomOut.d.ts +7 -0
  166. package/dist/cli/lib/testHelpers/makeCustomOut.d.ts.map +1 -0
  167. package/dist/cli/lib/testHelpers/makeCustomOut.js +10 -0
  168. package/dist/cli/lib/testHelpers/makeCustomOut.js.map +1 -0
  169. package/dist/cli/lib/timeProfier.js +4 -6
  170. package/dist/cli/lib/timeProfier.js.map +1 -1
  171. package/dist/cli/lib/validateConfig.js +21 -24
  172. package/dist/cli/lib/validateConfig.unitTest.d.ts +2 -0
  173. package/dist/cli/lib/validateConfig.unitTest.d.ts.map +1 -0
  174. package/dist/cli/lib/validateConfig.unitTest.js +17 -18
  175. package/dist/cli/lib/validateConfig.unitTest.js.map +1 -0
  176. package/dist/cli/lib/{watchFiles.js → watchFiles.d.ts} +2 -1
  177. package/dist/cli/lib/watchFiles.d.ts.map +1 -0
  178. package/dist/cli/lib/watchFiles.js.map +1 -0
  179. package/dist/cli/lib/watchFiles.unitTest.d.ts +2 -0
  180. package/dist/cli/lib/watchFiles.unitTest.d.ts.map +1 -0
  181. package/dist/cli/lib/watchFiles.unitTest.js.map +1 -0
  182. package/dist/cli/lib/watchFilesAndRunTests.js +2 -3
  183. package/dist/cli/lib/watchFilesAndRunTests.unitTest.d.ts +2 -0
  184. package/dist/cli/lib/watchFilesAndRunTests.unitTest.d.ts.map +1 -0
  185. package/dist/cli/lib/watchFilesAndRunTests.unitTest.js +86 -96
  186. package/dist/cli/lib/watchFilesAndRunTests.unitTest.js.map +1 -0
  187. package/dist/cli/lib/watchFilesAndRunTestsChokidar.d.ts.map +1 -1
  188. package/dist/cli/lib/watchFilesAndRunTestsChokidar.js +99 -127
  189. package/dist/cli/lib/watchFilesAndRunTestsChokidar.js.map +1 -1
  190. package/dist/cli/lib/watchFilesAndRunTestsChokidar.unitTest.d.ts +2 -0
  191. package/dist/cli/lib/watchFilesAndRunTestsChokidar.unitTest.d.ts.map +1 -0
  192. package/dist/cli/lib/watchFilesAndRunTestsChokidar.unitTest.js +90 -99
  193. package/dist/cli/lib/watchFilesAndRunTestsChokidar.unitTest.js.map +1 -0
  194. package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.d.ts.map +1 -1
  195. package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.js +108 -148
  196. package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.js.map +1 -1
  197. package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.unitTest.d.ts +2 -0
  198. package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.unitTest.d.ts.map +1 -0
  199. package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.unitTest.js +87 -100
  200. package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.unitTest.js.map +1 -0
  201. package/dist/cli/lib/watchFilesChokidar.js +30 -56
  202. package/dist/cli/lib/watchFilesChokidar.js.map +1 -1
  203. package/dist/cli/lib/watchFilesChokidar.unitTest.d.ts +2 -0
  204. package/dist/cli/lib/watchFilesChokidar.unitTest.d.ts.map +1 -0
  205. package/dist/cli/lib/watchFilesChokidar.unitTest.js +77 -81
  206. package/dist/cli/lib/watchFilesChokidar.unitTest.js.map +1 -0
  207. package/dist/cli/lib/watchFilesNodeWatch.js +31 -41
  208. package/dist/cli/lib/watchFilesNodeWatch.js.map +1 -1
  209. package/dist/cli/lib/watchFilesNodeWatch.unitTest.d.ts +2 -0
  210. package/dist/cli/lib/watchFilesNodeWatch.unitTest.d.ts.map +1 -0
  211. package/dist/cli/lib/watchFilesNodeWatch.unitTest.js +41 -46
  212. package/dist/cli/lib/watchFilesNodeWatch.unitTest.js.map +1 -0
  213. package/dist/cli/once.js +35 -42
  214. package/dist/cli/once.js.map +1 -1
  215. package/dist/cli/watch.js +64 -114
  216. package/dist/cli/watch.js.map +1 -1
  217. package/dist/cli/watch.unitTest.d.ts +6 -0
  218. package/dist/cli/watch.unitTest.d.ts.map +1 -0
  219. package/dist/cli/watch.unitTest.js +100 -111
  220. package/dist/cli/watch.unitTest.js.map +1 -0
  221. package/dist/config.d.ts +1 -1
  222. package/dist/config.d.ts.map +1 -1
  223. package/dist/config.js +13 -2
  224. package/dist/config.js.map +1 -1
  225. package/dist/describe.js +20 -34
  226. package/dist/describe.js.map +1 -1
  227. package/dist/describe.unitTest.d.ts +2 -0
  228. package/dist/describe.unitTest.d.ts.map +1 -0
  229. package/dist/describe.unitTest.js +19 -23
  230. package/dist/describe.unitTest.js.map +1 -0
  231. package/dist/index.js +2 -1
  232. package/dist/indexNumberToLetters.js +12 -11
  233. package/dist/output.js +16 -18
  234. package/dist/packages/chalk.d.ts +14 -0
  235. package/dist/packages/chalk.d.ts.map +1 -0
  236. package/dist/packages/chalk.js +22 -0
  237. package/dist/packages/chalk.js.map +1 -0
  238. package/dist/packages/figures.d.ts +6 -0
  239. package/dist/packages/figures.d.ts.map +1 -0
  240. package/dist/packages/figures.js +24 -0
  241. package/dist/packages/figures.js.map +1 -0
  242. package/dist/packages/loadConfig.d.ts +3 -0
  243. package/dist/packages/loadConfig.d.ts.map +1 -0
  244. package/dist/packages/loadConfig.js +28 -0
  245. package/dist/packages/loadConfig.js.map +1 -0
  246. package/dist/packages/mergeStructuredConfig.d.ts +2 -0
  247. package/dist/packages/mergeStructuredConfig.d.ts.map +1 -0
  248. package/dist/packages/mergeStructuredConfig.js +26 -0
  249. package/dist/packages/mergeStructuredConfig.js.map +1 -0
  250. package/dist/packages/slash.d.ts +2 -0
  251. package/dist/packages/slash.d.ts.map +1 -0
  252. package/dist/packages/slash.js +9 -0
  253. package/dist/packages/slash.js.map +1 -0
  254. package/dist/packages/timeProfiler.d.ts +6 -0
  255. package/dist/packages/timeProfiler.d.ts.map +1 -0
  256. package/dist/packages/timeProfiler.js +32 -0
  257. package/dist/packages/timeProfiler.js.map +1 -0
  258. package/dist/types.d.ts +13 -13
  259. package/dist/types.d.ts.map +1 -1
  260. package/package.json +24 -20
  261. package/dist/cli/files.js +0 -20
  262. package/dist/cli/files.unitTest.js +0 -246
  263. package/dist/cli/init.unitTest.js +0 -0
  264. package/dist/cli/lib/defaultConfig.test.js +0 -9
  265. package/dist/cli/lib/loadTestFileStatic.js +0 -41
  266. package/dist/cli/lib/loadTestFileStatic.unitTest.js +0 -30
  267. package/dist/cli/lib/processWatchEvent.js +0 -1
  268. package/dist/cli/lib/processWatchEvent.unitTest.js +0 -15
  269. package/dist/cli/lib/runDescribe.old.js +0 -108
  270. package/dist/cli/lib/runDescribe.old.unitTest.js +0 -440
  271. package/dist/cli/lib/runTest-old.js +0 -160
  272. package/dist/cli/lib/runTest-old.unitTest.js +0 -184
  273. package/dist/cli/lib/watchFiles.unitTest.js +0 -50
  274. package/dist/cli/once.unitTest.js +0 -39
  275. package/dist/describe-old.js +0 -271
  276. package/dist/describe-old.unitTest.js +0 -30
  277. package/dist/exported.eslintrc.js +0 -7
  278. package/dist/lib/arrayRemove.d.ts +0 -2
  279. package/dist/lib/arrayRemove.d.ts.map +0 -1
  280. package/dist/lib/arrayRemove.js +0 -15
  281. package/dist/lib/arrayRemove.js.map +0 -1
  282. package/dist/lib/promiseAllObj.d.ts +0 -2
  283. package/dist/lib/promiseAllObj.d.ts.map +0 -1
  284. package/dist/lib/promiseAllObj.js +0 -14
  285. package/dist/lib/promiseAllObj.js.map +0 -1
  286. package/dist/testsState.js +0 -5
  287. package/dist/timeProfiling.js +0 -9
@@ -1,26 +1,18 @@
1
- import { loadConfig as sxyLoadConfig, createTimeProfiler } from 'sxy-dev-tools';
2
- import { packageName, cliName, configFileName, configLocations, showTimeProfiling } from '../../config.js';
3
- import chalk from 'chalk-extensions';
4
- import { globby } from 'globby';
5
- import { out, log, debug } from '../../output.js';
6
- const {
7
- timeProfileAsync
8
- } = await createTimeProfiler(showTimeProfiling);
1
+ import { glob } from 'fs/promises';
2
+ import slash from '../../packages/slash.js';
9
3
  import { addBasePath } from './addBasePath.js';
10
4
  export async function findTestFiles(config) {
11
- return await timeProfileAsync('find test files', async () => {
12
- const testsGlobs = await addBasePath(config.testsBase, config.tests);
13
- const testsIgnoreGlobs = await addBasePath(config.testsBase, config.testsIgnore);
14
- await debug('testsGlobs', testsGlobs);
15
- await debug('testsIgnoreGlobs', testsIgnoreGlobs);
16
- const globOptions = {
17
- //cwd: projectDir,
18
- ignore: testsIgnoreGlobs
19
- };
20
-
21
- //const testFiles = globby(testsGlobs, testsIgnoreGlobs)
22
- const testFiles = await globby(testsGlobs, globOptions);
23
- await debug('testFiles', testFiles);
24
- return testFiles;
25
- });
26
- }
5
+ const testsGlobs = addBasePath(config.testsBase, config.tests);
6
+ const testsIgnoreGlobs = addBasePath(config.testsBase, config.testsIgnore);
7
+ // Node's built-in glob replaces the globby/tinyglobby dependency (no import cost).
8
+ // It yields OS-native separators, so slash() restores the forward-slash paths the
9
+ // rest of the runner relies on (watch-mode minimatch filters, dependency-tree keys).
10
+ const files = [];
11
+ for await (const file of glob(testsGlobs, {
12
+ exclude: Array.isArray(testsIgnoreGlobs) ? testsIgnoreGlobs : [testsIgnoreGlobs]
13
+ })) {
14
+ files.push(slash(file));
15
+ }
16
+ return files;
17
+ }
18
+ //# sourceMappingURL=findTestFiles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"findTestFiles.js","sourceRoot":"","sources":["../../../src/cli/lib/findTestFiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAG/B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAAc;IAC9C,MAAM,UAAU,GAAG,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;IAC9D,MAAM,gBAAgB,GAAG,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,CAAA;IAE1E,MAAM,WAAW,GAAG;QAChB,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC;KAClF,CAAA;IAED,OAAO,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,CAAA;AAC1C,CAAC"}
1
+ {"version":3,"file":"findTestFiles.js","sourceRoot":"","sources":["../../../src/cli/lib/findTestFiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,MAAM,yBAAyB,CAAA;AAG3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAAc;IAC9C,MAAM,UAAU,GAAG,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;IAC9D,MAAM,gBAAgB,GAAG,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,CAAA;IAE1E,mFAAmF;IACnF,kFAAkF;IAClF,qFAAqF;IACrF,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;QACtC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC;KACnF,CAAC,EAAE,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;IAC3B,CAAC;IAED,OAAO,KAAK,CAAA;AAChB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=findTestFiles.unitTest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findTestFiles.unitTest.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/findTestFiles.unitTest.ts"],"names":[],"mappings":""}
@@ -1,24 +1,24 @@
1
1
  import { applyConfigDefaults } from './applyConfigDefaults.js';
2
2
  import { findTestFiles } from './findTestFiles.js';
3
-
4
3
  // findTestFiles(config)
5
-
6
- await mochaDescribe('findTestFiles() function', async function () {
7
- await mochaIt('finds the tests files', async function () {
8
- // get the default configs
9
- const config = await applyConfigDefaults({
10
- tests: 'unitTesting/**/*.test.js'
4
+ mochaDescribe('findTestFiles() function', function () {
5
+ mochaIt('finds the tests files', async function () {
6
+ // get the default configs
7
+ const config = applyConfigDefaults({ tests: 'unitTesting/**/*.test.js' });
8
+ const testFiles = await findTestFiles(config);
9
+ testFiles.should.include.members([
10
+ 'unitTesting/sampleTests/1.test.js',
11
+ 'unitTesting/sampleTests/2.test.js'
12
+ ]);
11
13
  });
12
- const testFiles = await findTestFiles(config);
13
- await testFiles.should.include.members(['unitTesting/sampleTests/1.test.js', 'unitTesting/sampleTests/2.test.js']);
14
- });
15
- await mochaIt('respects tests base config entry', async function () {
16
- // get the default configs
17
- const config = await applyConfigDefaults({
18
- testsBase: 'src',
19
- tests: 'unitTesting/**/*.test.js'
14
+ mochaIt('respects tests base config entry', async function () {
15
+ // get the default configs
16
+ const config = applyConfigDefaults({
17
+ testsBase: 'src',
18
+ tests: 'unitTesting/**/*.test.js'
19
+ });
20
+ const testFiles = await findTestFiles(config);
21
+ testFiles.length.should.equal(0);
20
22
  });
21
- const testFiles = await findTestFiles(config);
22
- await testFiles.length.should.equal(0);
23
- });
24
- });
23
+ });
24
+ //# sourceMappingURL=findTestFiles.unitTest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findTestFiles.unitTest.js","sourceRoot":"","sources":["../../../src/cli/lib/findTestFiles.unitTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,wBAAwB;AAExB,aAAa,CAAC,0BAA0B,EAAE;IACtC,OAAO,CAAC,uBAAuB,EAAE,KAAK;QAClC,0BAA0B;QAC1B,MAAM,MAAM,GAAG,mBAAmB,CAAC,EAAE,KAAK,EAAE,0BAA0B,EAAE,CAAC,CAAA;QAEzE,MAAM,SAAS,GAAG,MAAM,aAAa,CAAC,MAAM,CAAC,CAAA;QAE7C,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;YAC7B,mCAAmC;YACnC,mCAAmC;SACtC,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;IAEF,OAAO,CAAC,kCAAkC,EAAE,KAAK;QAC7C,0BAA0B;QAC1B,MAAM,MAAM,GAAG,mBAAmB,CAAC;YAC/B,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,0BAA0B;SACpC,CAAC,CAAA;QAEF,MAAM,SAAS,GAAG,MAAM,aAAa,CAAC,MAAM,CAAC,CAAA;QAE7C,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IACpC,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA"}
@@ -1,9 +1,11 @@
1
- export async function getAllowedFlags(allowedArguments) {
2
- const allowedFlags = {};
3
- for (const option in allowedArguments) {
4
- if ('flag' in allowedArguments[option]) {
5
- allowedFlags[allowedArguments[option].flag] = option;
1
+ export function getAllowedFlags(allowedArguments) {
2
+ const allowedFlags = {};
3
+ for (const option in allowedArguments) {
4
+ const argument = allowedArguments[option];
5
+ if (argument && 'flag' in argument) {
6
+ allowedFlags[argument.flag] = option;
7
+ }
6
8
  }
7
- }
8
- return allowedFlags;
9
- }
9
+ return allowedFlags;
10
+ }
11
+ //# sourceMappingURL=getAllowedFlags.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=getAllowedFlags.unitTest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAllowedFlags.unitTest.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/getAllowedFlags.unitTest.ts"],"names":[],"mappings":""}
@@ -1,22 +1,23 @@
1
1
  import { getAllowedFlags } from './getAllowedFlags.js';
2
-
3
- // findTestFiles(config)
4
-
5
- await mochaDescribe('getAllowedFlags() function', async function () {
6
- await mochaIt('extracts the flags from an allowedArguments object', async function () {
7
- const allowedArguments = {
8
- 'config': {
9
- flag: 'c',
10
- hasValue: true
11
- },
12
- 'watch': {
13
- flag: 'w',
14
- hasValue: false
15
- }
16
- };
17
- const allowedFlags = await getAllowedFlags(allowedArguments);
18
- await allowedFlags.should.have.keys(['c', 'w']);
19
- await allowedFlags.c.should.equal('config');
20
- await allowedFlags.w.should.equal('watch');
21
- });
22
- });
2
+ mochaDescribe('getAllowedFlags() function', function () {
3
+ mochaIt('extracts the flags from an allowedArguments object', function () {
4
+ const allowedArguments = {
5
+ config: {
6
+ flag: 'c',
7
+ hasValue: true
8
+ },
9
+ watch: {
10
+ flag: 'w',
11
+ hasValue: false
12
+ }
13
+ };
14
+ const allowedFlags = getAllowedFlags(allowedArguments);
15
+ allowedFlags.should.have.keys([
16
+ 'c',
17
+ 'w'
18
+ ]);
19
+ allowedFlags.c?.should.equal('config');
20
+ allowedFlags.w?.should.equal('watch');
21
+ });
22
+ });
23
+ //# sourceMappingURL=getAllowedFlags.unitTest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAllowedFlags.unitTest.js","sourceRoot":"","sources":["../../../src/cli/lib/getAllowedFlags.unitTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAGtD,aAAa,CAAC,4BAA4B,EAAE;IACxC,OAAO,CAAC,oDAAoD,EAAE;QAC1D,MAAM,gBAAgB,GAAqB;YACvC,MAAM,EAAE;gBACJ,IAAI,EAAE,GAAG;gBACT,QAAQ,EAAE,IAAI;aACjB;YACD,KAAK,EAAE;gBACH,IAAI,EAAE,GAAG;gBACT,QAAQ,EAAE,KAAK;aAClB;SACJ,CAAA;QAED,MAAM,YAAY,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAA;QAEtD,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;YAC1B,GAAG;YACH,GAAG;SACN,CAAC,CAAA;QAEF,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;QACtC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACzC,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA"}
@@ -1 +1,8 @@
1
- export const globArgCombine = patterns => Array.isArray(patterns) ? patterns.length > 1 ? '{' + patterns.join(',') + '}' : patterns[0] : patterns;
1
+ export function globArgCombine(patterns) {
2
+ if (!Array.isArray(patterns))
3
+ return patterns;
4
+ return (patterns.length > 1)
5
+ ? '{' + patterns.join(',') + '}'
6
+ : (patterns[0] ?? '');
7
+ }
8
+ //# sourceMappingURL=globArgCombine.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=globArgCombine.unitTest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globArgCombine.unitTest.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/globArgCombine.unitTest.ts"],"names":[],"mappings":""}
@@ -1,18 +1,19 @@
1
- import { globArgCombine } from "./globArgCombine.js";
2
- await mochaDescribe('globArgCombine() function', async function () {
3
- await mochaIt('leaves strings alone', async function () {
4
- const testString = '*.test.js';
5
- const result = await globArgCombine(testString);
6
- await result.should.equal(testString);
7
- });
8
- await mochaIt('extracts the item from a single item array', async function () {
9
- const testStringsArray = ['*.test.js'];
10
- const result = await globArgCombine(testStringsArray);
11
- await result.should.equal(testStringsArray[0]);
12
- });
13
- await mochaIt('combined an array into a multi option glob e.g. {a,b}', async function () {
14
- const testStringsArray = ['*.test.js', '*.spec.js'];
15
- const result = await globArgCombine(testStringsArray);
16
- await result.should.equal(`{${testStringsArray[0]},${testStringsArray[1]}}`);
17
- });
18
- });
1
+ import { globArgCombine } from './globArgCombine.js';
2
+ mochaDescribe('globArgCombine() function', function () {
3
+ mochaIt('leaves strings alone', function () {
4
+ const testString = '*.test.js';
5
+ const result = globArgCombine(testString);
6
+ result.should.equal(testString);
7
+ });
8
+ mochaIt('extracts the item from a single item array', function () {
9
+ const testStringsArray = ['*.test.js'];
10
+ const result = globArgCombine(testStringsArray);
11
+ result.should.equal(testStringsArray[0]);
12
+ });
13
+ mochaIt('combined an array into a multi option glob e.g. {a,b}', function () {
14
+ const testStringsArray = ['*.test.js', '*.spec.js'];
15
+ const result = globArgCombine(testStringsArray);
16
+ result.should.equal(`{${testStringsArray[0]},${testStringsArray[1]}}`);
17
+ });
18
+ });
19
+ //# sourceMappingURL=globArgCombine.unitTest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globArgCombine.unitTest.js","sourceRoot":"","sources":["../../../src/cli/lib/globArgCombine.unitTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEpD,aAAa,CAAC,2BAA2B,EAAE;IACvC,OAAO,CAAC,sBAAsB,EAAE;QAC5B,MAAM,UAAU,GAAG,WAAW,CAAA;QAE9B,MAAM,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,CAAA;QAEzC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;IACnC,CAAC,CAAC,CAAA;IAEF,OAAO,CAAC,4CAA4C,EAAE;QAClD,MAAM,gBAAgB,GAAG,CAAC,WAAW,CAAC,CAAA;QAEtC,MAAM,MAAM,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAAA;QAE/C,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAA;IAC5C,CAAC,CAAC,CAAA;IAEF,OAAO,CAAC,uDAAuD,EAAE;QAC7D,MAAM,gBAAgB,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAA;QAEnD,MAAM,MAAM,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAAA;QAE/C,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;IAC1E,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"injectProperties.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/injectProperties.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAcxD,wBAAgB,gBAAgB,CAC5B,WAAW,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK,GACrF,IAAI,CAQN"}
1
+ {"version":3,"file":"injectProperties.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/injectProperties.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAExD,wBAAgB,gBAAgB,CAC5B,WAAW,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK,GACrF,IAAI,CAQN"}
@@ -1,11 +1,11 @@
1
- import { out as mainOut, log, debug } from '../../output.js';
2
- const reservedKeys = ['describe', 'test', 'it', 'before', 'after', 'beforeEach', 'afterEach', 'beforeAll', 'afterAll'];
3
- export async function injectProperties(basePackage, injectProperties, from, customOut = undefined) {
4
- const out = customOut ? async (...texts) => await customOut(...texts) : async (...texts) => await mainOut(...texts);
5
- for (const key in injectProperties) {
6
- if (await reservedKeys.includes(key)) {
7
- await out(`Error: key '${key}' is reserved. Please do not use this key. From '${from}'.`);
8
- //process.exit(1)
1
+ import { out as mainOut } from '../../output.js';
2
+ import { reservedExportKeys } from './reservedExportKeys.js';
3
+ export function injectProperties(basePackage, injectProperties, from, customOut) {
4
+ const out = customOut ?? mainOut;
5
+ for (const key in injectProperties) {
6
+ if (reservedExportKeys.includes(key)) {
7
+ out(`Error: key '${key}' is reserved. Please do not use this key. From '${from}'.`);
8
+ }
9
9
  }
10
- }
11
- }
10
+ }
11
+ //# sourceMappingURL=injectProperties.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"injectProperties.js","sourceRoot":"","sources":["../../../src/cli/lib/injectProperties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAGhD,MAAM,YAAY,GAAG;IACjB,UAAU;IACV,MAAM;IACN,IAAI;IACJ,QAAQ;IACR,OAAO;IACP,YAAY;IACZ,WAAW;IACX,WAAW;IACX,UAAU;CACb,CAAA;AAED,MAAM,UAAU,gBAAgB,CAC5B,WAAoB,EAAE,gBAA6B,EAAE,IAAY,EAAE,SAAiB;IAEpF,MAAM,GAAG,GAAG,SAAS,IAAI,OAAO,CAAA;IAEhC,KAAK,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAC;QACjC,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7B,GAAG,CAAC,eAAe,GAAG,oDAAoD,IAAI,IAAI,CAAC,CAAA;QACvF,CAAC;IACL,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"injectProperties.js","sourceRoot":"","sources":["../../../src/cli/lib/injectProperties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAG5D,MAAM,UAAU,gBAAgB,CAC5B,WAAoB,EAAE,gBAA6B,EAAE,IAAY,EAAE,SAAiB;IAEpF,MAAM,GAAG,GAAG,SAAS,IAAI,OAAO,CAAA;IAEhC,KAAK,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAC;QACjC,IAAI,kBAAkB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACnC,GAAG,CAAC,eAAe,GAAG,oDAAoD,IAAI,IAAI,CAAC,CAAA;QACvF,CAAC;IACL,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=injectProperties.unitTest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"injectProperties.unitTest.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/injectProperties.unitTest.ts"],"names":[],"mappings":""}
@@ -1,81 +1,19 @@
1
- import { injectProperties } from "./injectProperties.js";
2
- import chalk from 'chalk-extensions';
3
- await mochaDescribe('injectProperties() function', async function () {
4
- await mochaIt('complains if a reserved property is given', async function () {
5
- let outBuffer = '';
6
- const customOut = (...texts) => {
7
- //console.log(chalk.red`outBuffer1`, outBuffer)
8
- console.log(...texts);
9
- outBuffer += texts.join(' ') + '\n'; // join and save to the buffer
10
- //console.log(chalk.red`outBuffer2`, outBuffer)
11
- };
12
- const errorString = 'is reserved';
13
- const basePacket = {};
14
- let properties;
15
- outBuffer = '';
16
- properties = {
17
- describe: true
18
- };
19
- await injectProperties(basePacket, properties, '', customOut);
20
- await outBuffer.should.include(errorString);
21
- outBuffer = '';
22
- properties = {
23
- it: true
24
- };
25
- await injectProperties(basePacket, properties, '', customOut);
26
- await outBuffer.should.include(errorString);
27
- outBuffer = '';
28
- properties = {
29
- test: true
30
- };
31
- await injectProperties(basePacket, properties, '', customOut);
32
- await outBuffer.should.include(errorString);
33
- outBuffer = '';
34
- properties = {
35
- before: true
36
- };
37
- await injectProperties(basePacket, properties, '', customOut);
38
- await outBuffer.should.include(errorString);
39
- outBuffer = '';
40
- properties = {
41
- after: true
42
- };
43
- await injectProperties(basePacket, properties, '', customOut);
44
- await outBuffer.should.include(errorString);
45
- outBuffer = '';
46
- properties = {
47
- beforeEach: true
48
- };
49
- await injectProperties(basePacket, properties, '', customOut);
50
- await outBuffer.should.include(errorString);
51
- outBuffer = '';
52
- properties = {
53
- afterEach: true
54
- };
55
- await injectProperties(basePacket, properties, '', customOut);
56
- await outBuffer.should.include(errorString);
57
- });
58
-
59
- // mochaIt('complains if a passed property conflics with a base property', function() {
60
-
61
- // let outBuffer = ''
62
- // const customOut = sync((...texts) => {
63
- // console.log(...texts)
64
- // outBuffer += texts.join(' ') + '\n' // join and save to the buffer
65
- // })
66
-
67
- // const errorString = 'is reserved'
68
-
69
- // const basePacket = {}
70
-
71
- // let properties
72
-
73
- // outBuffer = ''
74
- // properties = {
75
- // describe: true
76
- // }
77
- // injectProperties(basePacket, properties, '', customOut)
78
- // outBuffer.should.include(errorString)
79
-
80
- // })
81
- });
1
+ import { injectProperties } from './injectProperties.js';
2
+ mochaDescribe('injectProperties() function', function () {
3
+ mochaIt('complains if a reserved property is given', function () {
4
+ let outBuffer = '';
5
+ const customOut = (...texts) => {
6
+ console.log(...texts); // eslint-disable-line no-console
7
+ outBuffer += texts.join(' ') + '\n'; // join and save to the buffer
8
+ };
9
+ const errorString = 'is reserved';
10
+ const basePacket = {};
11
+ const reservedKeys = ['describe', 'it', 'test', 'before', 'after', 'beforeEach', 'afterEach'];
12
+ for (const key of reservedKeys) {
13
+ outBuffer = '';
14
+ injectProperties(basePacket, { [key]: true }, '', customOut);
15
+ outBuffer.should.include(errorString);
16
+ }
17
+ });
18
+ });
19
+ //# sourceMappingURL=injectProperties.unitTest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"injectProperties.unitTest.js","sourceRoot":"","sources":["../../../src/cli/lib/injectProperties.unitTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,aAAa,CAAC,6BAA6B,EAAE;IACzC,OAAO,CAAC,2CAA2C,EAAE;QACjD,IAAI,SAAS,GAAG,EAAE,CAAA;QAClB,MAAM,SAAS,GAAG,CAAC,GAAG,KAAgB,EAAQ,EAAE;YAC5C,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAA,CAAC,iCAAiC;YACvD,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAA,CAAC,8BAA8B;QACtE,CAAC,CAAA;QAED,MAAM,WAAW,GAAG,aAAa,CAAA;QACjC,MAAM,UAAU,GAAG,EAAE,CAAA;QACrB,MAAM,YAAY,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,CAAC,CAAA;QAE7F,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;YAC7B,SAAS,GAAG,EAAE,CAAA;YACd,gBAAgB,CAAC,UAAU,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,SAAS,CAAC,CAAA;YAC5D,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;QACzC,CAAC;IACL,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA"}
@@ -1,21 +1,17 @@
1
- import { loadConfig as sxyLoadConfig, loadConfigExact as sxyLoadConfigExact, createTimeProfiler } from 'sxy-dev-tools';
2
- import { packageName, cliName, configFileName, configLocations, showTimeProfiling } from '../../config.js';
3
- import chalk from 'chalk-extensions';
4
- import { out, log, debug } from '../../output.js';
5
- const {
6
- timeProfileAsync
7
- } = await createTimeProfiler(showTimeProfiling);
8
- export async function loadConfig(customLocation = undefined) {
9
- return await timeProfileAsync('load config', async () => {
10
- const configOrNull = customLocation !== undefined ? await sxyLoadConfigExact(customLocation) : await sxyLoadConfig(configFileName, configLocations);
11
- await debug('configOrNull', typeof configOrNull, configOrNull);
1
+ import { loadConfig as sxyLoadConfig, loadConfigExact as sxyLoadConfigExact } from '../../packages/loadConfig.js';
2
+ import { packageName, cliName, configFileName, configLocations } from '../../config.js';
3
+ import chalk from '../../packages/chalk.js';
4
+ import { out } from '../../output.js';
5
+ export async function loadConfig(customLocation) {
6
+ const configOrNull = (customLocation !== undefined)
7
+ ? await sxyLoadConfigExact(customLocation)
8
+ : await sxyLoadConfig(configFileName, configLocations);
12
9
  if (!configOrNull) {
13
- await out(await chalk.orange(`[${packageName}] No config found.` + `\nPlease create a ${configFileName}.js/cjs/mjs file in your project root or /config folder.` + `\nOr run \`npx ${cliName} init\` to create one.`));
14
- await process.exit(0);
10
+ out(chalk.orange(`[${packageName}] No config found.`
11
+ + `\nPlease create a ${configFileName}.js/cjs/mjs file in your project root or /config folder.`
12
+ + `\nOr run \`npx ${cliName} init\` to create one.`));
13
+ process.exit(0);
15
14
  }
16
-
17
- //log('user config', configOrNull)
18
-
19
15
  return configOrNull;
20
- });
21
- }
16
+ }
17
+ //# sourceMappingURL=loadConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"loadConfig.js","sourceRoot":"","sources":["../../../src/cli/lib/loadConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,eAAe,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClG,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACvF,OAAO,KAAK,MAAM,kBAAkB,CAAA;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAGrC,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,cAAuB;IACpD,MAAM,YAAY,GAAG,CAAC,cAAc,KAAK,SAAS,CAAC;QAC/C,CAAC,CAAC,MAAM,kBAAkB,CAAa,cAAc,CAAC;QACtD,CAAC,CAAC,MAAM,aAAa,CAAa,cAAc,EAAE,eAAe,CAAC,CAAA;IAEtE,IAAI,CAAC,YAAY,EAAE,CAAC;QAChB,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,WAAW,oBAAoB;cAC9C,qBAAqB,cAAc,0DAA0D;cAC7F,kBAAkB,OAAO,wBAAwB,CAAC,CAAC,CAAA;QACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACnB,CAAC;IAED,OAAO,YAAY,CAAA;AACvB,CAAC"}
1
+ {"version":3,"file":"loadConfig.js","sourceRoot":"","sources":["../../../src/cli/lib/loadConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,eAAe,IAAI,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AACjH,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACvF,OAAO,KAAK,MAAM,yBAAyB,CAAA;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAGrC,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,cAAuB;IACpD,MAAM,YAAY,GAAG,CAAC,cAAc,KAAK,SAAS,CAAC;QAC/C,CAAC,CAAC,MAAM,kBAAkB,CAAa,cAAc,CAAC;QACtD,CAAC,CAAC,MAAM,aAAa,CAAa,cAAc,EAAE,eAAe,CAAC,CAAA;IAEtE,IAAI,CAAC,YAAY,EAAE,CAAC;QAChB,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,WAAW,oBAAoB;cAC9C,qBAAqB,cAAc,0DAA0D;cAC7F,kBAAkB,OAAO,wBAAwB,CAAC,CAAC,CAAA;QACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACnB,CAAC;IAED,OAAO,YAAY,CAAA;AACvB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=loadConfig.unitTest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadConfig.unitTest.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/loadConfig.unitTest.ts"],"names":[],"mappings":""}
@@ -1,16 +1,16 @@
1
- import { loadConfig } from "./loadConfig.js";
2
-
1
+ import { loadConfig } from './loadConfig.js';
3
2
  // loadConfig(location)
4
- // location is option
5
- await mochaDescribe('loadConfig() function', async function () {
6
- await mochaIt('loads a user config', async function () {
7
- const userConfig = await loadConfig();
8
- userConfig.should.not.be.null;
9
- });
10
- await mochaIt('loads a user config from a location passed to it', async function () {
11
- const configLocation = 'unitTesting/sampleConfig/sxy-test-runner.config.js';
12
- const userConfig = await loadConfig(configLocation);
13
- userConfig.should.not.be.null;
14
- await userConfig.tests.should.equal('alt-config-location');
15
- });
16
- });
3
+ // location is optional
4
+ mochaDescribe('loadConfig() function', function () {
5
+ mochaIt('loads a user config', async function () {
6
+ const userConfig = await loadConfig();
7
+ userConfig.should.not.be.null;
8
+ });
9
+ mochaIt('loads a user config from a location passed to it', async function () {
10
+ const configLocation = 'unitTesting/sampleConfig/sxy-test-runner.config.js';
11
+ const userConfig = await loadConfig(configLocation);
12
+ userConfig.should.not.be.null;
13
+ userConfig.tests?.should.equal('alt-config-location');
14
+ });
15
+ });
16
+ //# sourceMappingURL=loadConfig.unitTest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadConfig.unitTest.js","sourceRoot":"","sources":["../../../src/cli/lib/loadConfig.unitTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,uBAAuB;AACvB,uBAAuB;AACvB,aAAa,CAAC,uBAAuB,EAAE;IACnC,OAAO,CAAC,qBAAqB,EAAE,KAAK;QAChC,MAAM,UAAU,GAAG,MAAM,UAAU,EAAE,CAAA;QAErC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAA;IACjC,CAAC,CAAC,CAAA;IAEF,OAAO,CAAC,kDAAkD,EAAE,KAAK;QAC7D,MAAM,cAAc,GAAG,oDAAoD,CAAA;QAC3E,MAAM,UAAU,GAAG,MAAM,UAAU,CAAC,cAAc,CAAC,CAAA;QAEnD,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAA;QAC7B,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAA;IACzD,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA"}