sxy-test-runner 2.4.11 → 2.4.12

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 (121) hide show
  1. package/dist/checkMeta.js.map +1 -1
  2. package/dist/cli/cliTypes.d.ts +12 -0
  3. package/dist/cli/cliTypes.js +3 -0
  4. package/dist/cli/cliTypes.js.map +1 -0
  5. package/dist/cli/help.js.map +1 -1
  6. package/dist/cli/init.js +1 -1
  7. package/dist/cli/init.js.map +1 -1
  8. package/dist/cli/lib/addBasePath.js.map +1 -1
  9. package/dist/cli/lib/addExports.js +6 -1
  10. package/dist/cli/lib/addExports.js.map +1 -1
  11. package/dist/cli/lib/agentReport.d.ts +2 -1
  12. package/dist/cli/lib/agentReport.js.map +1 -1
  13. package/dist/cli/lib/alwaysCacheBust.js.map +1 -1
  14. package/dist/cli/lib/applyConfigDefaults.js.map +1 -1
  15. package/dist/cli/lib/buildDependencyTree.js.map +1 -1
  16. package/dist/cli/lib/buildDependencyTrees.js.map +1 -1
  17. package/dist/cli/lib/consoleCapture.js.map +1 -1
  18. package/dist/cli/lib/defaultConfig.js.map +1 -1
  19. package/dist/cli/lib/doUserSetup.js +1 -1
  20. package/dist/cli/lib/doUserSetup.js.map +1 -1
  21. package/dist/cli/lib/doUserTeardown.js +1 -1
  22. package/dist/cli/lib/doUserTeardown.js.map +1 -1
  23. package/dist/cli/lib/exitCodes.js.map +1 -1
  24. package/dist/cli/lib/failureEntries.d.ts +2 -1
  25. package/dist/cli/lib/failureEntries.js +2 -0
  26. package/dist/cli/lib/failureEntries.js.map +1 -1
  27. package/dist/cli/lib/failureLines.d.ts +2 -1
  28. package/dist/cli/lib/failureLines.js.map +1 -1
  29. package/dist/cli/lib/filter.js.map +1 -1
  30. package/dist/cli/lib/findTestFiles.js.map +1 -1
  31. package/dist/cli/lib/findingTestsMessage.d.ts +1 -1
  32. package/dist/cli/lib/findingTestsMessage.js.map +1 -1
  33. package/dist/cli/lib/getAllowedFlags.d.ts +1 -1
  34. package/dist/cli/lib/getAllowedFlags.js.map +1 -1
  35. package/dist/cli/lib/globArgCombine.js.map +1 -1
  36. package/dist/cli/lib/handleUserInput.d.ts +2 -2
  37. package/dist/cli/lib/handleUserInput.js +1 -1
  38. package/dist/cli/lib/handleUserInput.js.map +1 -1
  39. package/dist/cli/lib/injectProperties.js.map +1 -1
  40. package/dist/cli/lib/isTest.js.map +1 -1
  41. package/dist/cli/lib/listenToUser.d.ts +3 -3
  42. package/dist/cli/lib/listenToUser.js +33 -8
  43. package/dist/cli/lib/listenToUser.js.map +1 -1
  44. package/dist/cli/lib/loadConfig.js.map +1 -1
  45. package/dist/cli/lib/loadTestFile.d.ts +9 -1
  46. package/dist/cli/lib/loadTestFile.js +0 -1
  47. package/dist/cli/lib/loadTestFile.js.map +1 -1
  48. package/dist/cli/lib/makeWatchRunState.js.map +1 -1
  49. package/dist/cli/lib/parseCommandLineArguments.d.ts +1 -1
  50. package/dist/cli/lib/parseCommandLineArguments.js.map +1 -1
  51. package/dist/cli/lib/parseDescribe.js +3 -3
  52. package/dist/cli/lib/parseDescribe.js.map +1 -1
  53. package/dist/cli/lib/reRunManager.d.ts +1 -1
  54. package/dist/cli/lib/reRunManager.js +1 -1
  55. package/dist/cli/lib/reRunManager.js.map +1 -1
  56. package/dist/cli/lib/reservedExportKeys.js.map +1 -1
  57. package/dist/cli/lib/resolveCommand.js.map +1 -1
  58. package/dist/cli/lib/runDescribe.d.ts +16 -1
  59. package/dist/cli/lib/runDescribe.js.map +1 -1
  60. package/dist/cli/lib/runDescribeRun.d.ts +2 -1
  61. package/dist/cli/lib/runDescribeRun.js +1 -1
  62. package/dist/cli/lib/runDescribeRun.js.map +1 -1
  63. package/dist/cli/lib/runIt.d.ts +9 -1
  64. package/dist/cli/lib/runIt.js +11 -7
  65. package/dist/cli/lib/runIt.js.map +1 -1
  66. package/dist/cli/lib/runTasks.d.ts +1 -1
  67. package/dist/cli/lib/runTasks.js +6 -4
  68. package/dist/cli/lib/runTasks.js.map +1 -1
  69. package/dist/cli/lib/runTest.d.ts +18 -1
  70. package/dist/cli/lib/runTest.js +3 -3
  71. package/dist/cli/lib/runTest.js.map +1 -1
  72. package/dist/cli/lib/runTests.d.ts +15 -3
  73. package/dist/cli/lib/runTests.js +25 -8
  74. package/dist/cli/lib/runTests.js.map +1 -1
  75. package/dist/cli/lib/showTestLoadingError.d.ts +2 -1
  76. package/dist/cli/lib/showTestLoadingError.js.map +1 -1
  77. package/dist/cli/lib/showTestResult.d.ts +2 -1
  78. package/dist/cli/lib/showTestResult.js +47 -44
  79. package/dist/cli/lib/showTestResult.js.map +1 -1
  80. package/dist/cli/lib/showTtyHelp.js.map +1 -1
  81. package/dist/cli/lib/shutdown.d.ts +1 -1
  82. package/dist/cli/lib/shutdown.js +11 -3
  83. package/dist/cli/lib/shutdown.js.map +1 -1
  84. package/dist/cli/lib/statusFile.js.map +1 -1
  85. package/dist/cli/lib/stopSignal.js.map +1 -1
  86. package/dist/cli/lib/timeProfier.js.map +1 -1
  87. package/dist/cli/lib/validateConfig.js.map +1 -1
  88. package/dist/cli/lib/watchFilesAndRunTests.js.map +1 -1
  89. package/dist/cli/lib/watchFilesAndRunTestsChokidar.js +3 -3
  90. package/dist/cli/lib/watchFilesAndRunTestsChokidar.js.map +1 -1
  91. package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.d.ts +5 -3
  92. package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.js +18 -11
  93. package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.js.map +1 -1
  94. package/dist/cli/lib/watchFilesChokidar.d.ts +1 -3
  95. package/dist/cli/lib/watchFilesChokidar.js +52 -43
  96. package/dist/cli/lib/watchFilesChokidar.js.map +1 -1
  97. package/dist/cli/lib/watchFilesNodeWatch.d.ts +2 -3
  98. package/dist/cli/lib/watchFilesNodeWatch.js +3 -3
  99. package/dist/cli/lib/watchFilesNodeWatch.js.map +1 -1
  100. package/dist/cli/once.js.map +1 -1
  101. package/dist/cli/version.js.map +1 -1
  102. package/dist/cli/watch.d.ts +2 -0
  103. package/dist/cli/watch.js +43 -18
  104. package/dist/cli/watch.js.map +1 -1
  105. package/dist/config.js.map +1 -1
  106. package/dist/describe.js +1 -1
  107. package/dist/describe.js.map +1 -1
  108. package/dist/indexNumberToLetters.js.map +1 -1
  109. package/dist/meta.js.map +1 -1
  110. package/dist/output.js +2 -0
  111. package/dist/output.js.map +1 -1
  112. package/dist/packages/chalk.js.map +1 -1
  113. package/dist/packages/esmReload.js.map +1 -1
  114. package/dist/packages/figures.js.map +1 -1
  115. package/dist/packages/loadConfig.js.map +1 -1
  116. package/dist/packages/mergeStructuredConfig.js.map +1 -1
  117. package/dist/packages/slash.js.map +1 -1
  118. package/dist/packages/timeProfiler.js.map +1 -1
  119. package/dist/types.d.ts +13 -81
  120. package/dist/types.js.map +1 -1
  121. package/package.json +5 -4
@@ -1 +1 @@
1
- {"version":3,"file":"once.js","sourceRoot":"","sources":["../../src/cli/once.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,sBAAsB,CAAA;AAExC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAGvC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,0CAA0C;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAI1D,MAAM,CAAC,KAAK,UAAU,IAAI;IACtB,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAA;IAEtC,MAAM,EAAE,yBAAyB,EAAE,GAAG,MAAM,MAAM,CAA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IACD,kFAAkF;IAClF,6EAA6E;IAC7E,MAAM,QAAQ,GAAG,CAAC,WAAW,KAAK,IAAI,CAAC;QACnC,CAAC,CAAC,SAAS,CAAC,eAAe;QAC3B,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,UAAU,CAAA;IAE7D,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,SAAS,CAAA;IAC7C,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAA,KAAK,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;IAEpD,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAA;IAClE,MAAM,cAAc,CAAC,MAAM,CAAC,CAAA;IAE5B,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;AAC1B,CAAC","sourcesContent":["\nimport chalk from '../packages/chalk.js'\n\nimport { packageName, configFileNames } from '../config.js'\nimport { out, log } from '../output.js'\n\nimport type { AllowedArguments, OutFn } from '../types.js'\nimport { setEnv } from './lib/setEnv.js'\nimport { findingTestsMessage } from './lib/findingTestsMessage.js'\nimport { foundTestsMessage } from './lib/foundTestsMessage.js'\n//import { isTest } from './lib/isTest.js'\nimport { exitCodes } from './lib/exitCodes.js'\nimport { envFlag } from '../envFlag.js'\nimport { alwaysCacheBust } from './lib/alwaysCacheBust.js'\nimport { Concurrency } from './lib/runTests.js'\n\n\nexport async function once(): Promise<void> {\n const startTime = new Date().getTime()\n\n const { parseCommandLineArguments } = await import('./lib/parseCommandLineArguments.js')\n const allowedClArguments: AllowedArguments = {\n config: {\n flag: 'c',\n hasValue: true\n },\n 'test-files': {\n flag: 't',\n hasValue: true\n },\n filter: {\n flag: 'f',\n hasValue: true\n },\n 'filter-it': {\n flag: 'i',\n hasValue: true\n },\n 'filter-describe': {\n flag: 'd',\n hasValue: true\n },\n 'fail-fast': {\n flag: 'x',\n hasValue: false\n },\n 'agent': {\n hasValue: false\n }\n }\n const clArguments = parseCommandLineArguments(allowedClArguments)\n //debug('clArguments', clArguments)\n\n // agent mode owns stdout: the usual per-test output is routed into a sink, leaving the\n // failures and the summary. Announced before the config loads, as in watch mode.\n const agentMode = clArguments.agent === true\n const {\n agentInit, agentFound, agentRunStart, agentDone, agentSetRunReason, agentSilentOut\n } = await import('./lib/agentReport.js')\n agentInit(agentMode)\n agentSetRunReason('once')\n const agentOut: OutFn = (agentMode) ? agentSilentOut : out\n const runsOut = (agentMode) ? agentSilentOut : undefined\n\n agentOut(chalk.brightblue`[${packageName}]...`)\n\n setEnv()\n\n const { loadConfig } = await import('./lib/loadConfig.js')\n const userConfig = (typeof clArguments.config === 'string')\n ? await loadConfig(clArguments.config)\n : await loadConfig()\n\n if ('test-files' in clArguments) {\n const testFilesPattern = clArguments['test-files']\n if (typeof testFilesPattern !== 'string' || testFilesPattern === '') {\n throw new Error('No pattern specified for --test-files or -t argument')\n }\n //console.log('Looking for tests using pattern: ' + testFilesPattern) // eslint-disable-line no-console\n userConfig.tests = testFilesPattern\n }\n\n if ('filter' in clArguments) {\n const filter = clArguments.filter\n if (typeof filter !== 'string' || filter === '') {\n throw new Error('No pattern specified for --filter or -f argument')\n }\n //console.log('Filtering tests using pattern: ' + filter) // eslint-disable-line no-console\n userConfig.testsFilter = filter\n }\n\n const filterIt = clArguments['filter-it']\n const filterDescribe = clArguments['filter-describe']\n if (filterIt === true || filterIt === '') throw new Error('No substring specified for --filter-it')\n if (filterDescribe === true || filterDescribe === '') {\n throw new Error('No substring specified for --filter-describe')\n }\n\n const { applyConfigDefaults } = await import('./lib/applyConfigDefaults.js')\n const config = applyConfigDefaults(userConfig)\n // both flags are the only source: assigned rather than or'd, so a config file cannot\n // silently truncate every run, or swap the output format out from under a caller\n config.failFast = clArguments['fail-fast'] === true\n config.watch.agent = agentMode\n\n const { validateConfig } = await import('./lib/validateConfig.js')\n validateConfig(config)\n\n //console.log('run setup')\n //console.log(util.inspect(config))\n const { doUserSetup } = await import('./lib/doUserSetup.js')\n await doUserSetup(config, agentOut)\n //console.log('ran setup')\n \n agentOut(chalk.brightblue(findingTestsMessage(config)))\n const { findTestFiles } = await import('./lib/findTestFiles.js')\n const testFiles = await findTestFiles(config)\n agentFound(config, testFiles.size)\n\n if (testFiles.size === 0) {\n agentOut(chalk.mediumred(`[${packageName}] Found no tests.`\n + '\\nCreate tests matching the patterns, '\n + `\\nor set new patterns in ${configFileNames.map(x => `${x}.js/cjs/mjs`).join(' or ')}`))\n\n const endTime = new Date().getTime()\n const time = endTime - startTime\n agentOut(chalk.brightblue(`[${packageName}] time: ${time.toLocaleString()}ms`))\n\n // reported as a run, so a reader waiting on a done line always gets one\n const { statusCodes } = await import('./lib/statusFile.js')\n const run = agentRunStart(config, 0)\n agentDone(config, run, statusCodes.couldNotRun, 'no test files found', null, time, 0)\n\n // setup has already run by this point, so teardown must run too, or its side\n // effects are left behind\n const { doUserTeardown } = await import('./lib/doUserTeardown.js')\n await doUserTeardown(config)\n\n process.exit(exitCodes.noTestFiles)\n }\n\n agentOut(chalk.brightblue(foundTestsMessage(testFiles.size)))\n\n const concurrency: Concurrency = { limit: -1 }\n\n process.setSourceMapsEnabled(true) // enable source mapping\n \n // testFiles.size is guaranteed non-zero here - the no-tests case exited above\n const { runTests } = await import('./lib/runTests.js')\n if (!agentMode) log(chalk.brightblue`running tests...`)\n const testsResult = await runTests(\n config, testFiles,\n undefined,\n concurrency,\n (alwaysCacheBust) ? 'refresh' : 'cached',\n runsOut,\n {\n it: filterIt,\n describe: filterDescribe\n }\n )\n // a distinct code from noTestFiles, so callers can tell \"no test file matched the\n // pattern\" from \"the files matched but the filters selected nothing in them\"\n const exitCode = (testsResult === null)\n ? exitCodes.noMatchingTests\n : (testsResult) ? exitCodes.passed : exitCodes.testErrors\n\n const time = new Date().getTime() - startTime\n agentOut(chalk.grey`\\n${time.toLocaleString()}ms\\n`)\n\n const { doUserTeardown } = await import('./lib/doUserTeardown.js')\n await doUserTeardown(config)\n\n process.exit(exitCode)\n}\n"]}
1
+ {"version":3,"file":"once.js","sourceRoot":"","sources":["../../src/cli/once.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,sBAAsB,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,0CAA0C;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAG1D,MAAM,CAAC,KAAK,UAAU,IAAI;IACtB,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAA;IAEtC,MAAM,EAAE,yBAAyB,EAAE,GAAG,MAAM,MAAM,CAAC,oCAAoC,CAAC,CAAA;IACxF,MAAM,kBAAkB,GAAqB;QACzC,MAAM,EAAE;YACJ,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,IAAI;SACjB;QACD,YAAY,EAAE;YACV,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,IAAI;SACjB;QACD,MAAM,EAAE;YACJ,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,IAAI;SACjB;QACD,WAAW,EAAE;YACT,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,IAAI;SACjB;QACD,iBAAiB,EAAE;YACf,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,IAAI;SACjB;QACD,WAAW,EAAE;YACT,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,KAAK;SAClB;QACD,OAAO,EAAE;YACL,QAA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,CAAC,MAAM,CAAC,CAAA;IAE5B,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;AAC1B,CAAC","sourcesContent":["\nimport type { OutFn } from '../types.js'\nimport type { AllowedArguments } from './cliTypes.js'\nimport type { Concurrency } from './lib/runTests.js'\nimport chalk from '../packages/chalk.js'\nimport { packageName, configFileNames } from '../config.js'\nimport { out, log } from '../output.js'\nimport { setEnv } from './lib/setEnv.js'\nimport { findingTestsMessage } from './lib/findingTestsMessage.js'\nimport { foundTestsMessage } from './lib/foundTestsMessage.js'\n//import { isTest } from './lib/isTest.js'\nimport { exitCodes } from './lib/exitCodes.js'\nimport { alwaysCacheBust } from './lib/alwaysCacheBust.js'\n\n\nexport async function once(): Promise<void> {\n const startTime = new Date().getTime()\n\n const { parseCommandLineArguments } = await import('./lib/parseCommandLineArguments.js')\n const allowedClArguments: AllowedArguments = {\n config: {\n flag: 'c',\n hasValue: true\n },\n 'test-files': {\n flag: 't',\n hasValue: true\n },\n filter: {\n flag: 'f',\n hasValue: true\n },\n 'filter-it': {\n flag: 'i',\n hasValue: true\n },\n 'filter-describe': {\n flag: 'd',\n hasValue: true\n },\n 'fail-fast': {\n flag: 'x',\n hasValue: false\n },\n 'agent': {\n hasValue: false\n }\n }\n const clArguments = parseCommandLineArguments(allowedClArguments)\n //debug('clArguments', clArguments)\n\n // agent mode owns stdout: the usual per-test output is routed into a sink, leaving the\n // failures and the summary. Announced before the config loads, as in watch mode.\n const agentMode = clArguments.agent === true\n const {\n agentInit, agentFound, agentRunStart, agentDone, agentSetRunReason, agentSilentOut\n } = await import('./lib/agentReport.js')\n agentInit(agentMode)\n agentSetRunReason('once')\n const agentOut: OutFn = (agentMode) ? agentSilentOut : out\n const runsOut = (agentMode) ? agentSilentOut : undefined\n\n agentOut(chalk.brightblue`[${packageName}]...`)\n\n setEnv()\n\n const { loadConfig } = await import('./lib/loadConfig.js')\n const userConfig = (typeof clArguments.config === 'string')\n ? await loadConfig(clArguments.config)\n : await loadConfig()\n\n if ('test-files' in clArguments) {\n const testFilesPattern = clArguments['test-files']\n if (typeof testFilesPattern !== 'string' || testFilesPattern === '') {\n throw new Error('No pattern specified for --test-files or -t argument')\n }\n //console.log('Looking for tests using pattern: ' + testFilesPattern) // eslint-disable-line no-console\n userConfig.tests = testFilesPattern\n }\n\n if ('filter' in clArguments) {\n const filter = clArguments.filter\n if (typeof filter !== 'string' || filter === '') {\n throw new Error('No pattern specified for --filter or -f argument')\n }\n //console.log('Filtering tests using pattern: ' + filter) // eslint-disable-line no-console\n userConfig.testsFilter = filter\n }\n\n const filterIt = clArguments['filter-it']\n const filterDescribe = clArguments['filter-describe']\n if (filterIt === true || filterIt === '') throw new Error('No substring specified for --filter-it')\n if (filterDescribe === true || filterDescribe === '') {\n throw new Error('No substring specified for --filter-describe')\n }\n\n const { applyConfigDefaults } = await import('./lib/applyConfigDefaults.js')\n const config = applyConfigDefaults(userConfig)\n // both flags are the only source: assigned rather than or'd, so a config file cannot\n // silently truncate every run, or swap the output format out from under a caller\n config.failFast = clArguments['fail-fast'] === true\n config.watch.agent = agentMode\n\n const { validateConfig } = await import('./lib/validateConfig.js')\n validateConfig(config)\n\n //console.log('run setup')\n //console.log(util.inspect(config))\n const { doUserSetup } = await import('./lib/doUserSetup.js')\n await doUserSetup(config, agentOut)\n //console.log('ran setup')\n \n agentOut(chalk.brightblue(findingTestsMessage(config)))\n const { findTestFiles } = await import('./lib/findTestFiles.js')\n const testFiles = await findTestFiles(config)\n agentFound(config, testFiles.size)\n\n if (testFiles.size === 0) {\n agentOut(chalk.mediumred(`[${packageName}] Found no tests.`\n + '\\nCreate tests matching the patterns, '\n + `\\nor set new patterns in ${configFileNames.map(x => `${x}.js/cjs/mjs`).join(' or ')}`))\n\n const endTime = new Date().getTime()\n const time = endTime - startTime\n agentOut(chalk.brightblue(`[${packageName}] time: ${time.toLocaleString()}ms`))\n\n // reported as a run, so a reader waiting on a done line always gets one\n const { statusCodes } = await import('./lib/statusFile.js')\n const run = agentRunStart(config, 0)\n agentDone(config, run, statusCodes.couldNotRun, 'no test files found', null, time, 0)\n\n // setup has already run by this point, so teardown must run too, or its side\n // effects are left behind\n const { doUserTeardown } = await import('./lib/doUserTeardown.js')\n await doUserTeardown(config)\n\n process.exit(exitCodes.noTestFiles)\n }\n\n agentOut(chalk.brightblue(foundTestsMessage(testFiles.size)))\n\n const concurrency: Concurrency = { limit: -1 }\n\n process.setSourceMapsEnabled(true) // enable source mapping\n \n // testFiles.size is guaranteed non-zero here - the no-tests case exited above\n const { runTests } = await import('./lib/runTests.js')\n if (!agentMode) log(chalk.brightblue`running tests...`)\n const testsResult = await runTests(\n config, testFiles,\n undefined,\n concurrency,\n (alwaysCacheBust) ? 'refresh' : 'cached',\n runsOut,\n {\n it: filterIt,\n describe: filterDescribe\n }\n )\n // a distinct code from noTestFiles, so callers can tell \"no test file matched the\n // pattern\" from \"the files matched but the filters selected nothing in them\"\n const exitCode = (testsResult === null)\n ? exitCodes.noMatchingTests\n : (testsResult) ? exitCodes.passed : exitCodes.testErrors\n\n const time = new Date().getTime() - startTime\n agentOut(chalk.grey`\\n${time.toLocaleString()}ms\\n`)\n\n const { doUserTeardown } = await import('./lib/doUserTeardown.js')\n await doUserTeardown(config)\n\n process.exit(exitCode)\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/cli/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAElC,2FAA2F;AAC3F,0FAA0F;AAC1F,gCAAgC;AAChC,MAAM,UAAU,OAAO;IACnB,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IAE7E,IAAI,aAAa,GAAG,SAAS,CAAA;IAC7B,IAAI,CAAC;QACD,MAAM,GAAG,GAAG,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAA;QACnE,mEAAmE;QACnE,MAAM,WAAW,GAAyB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACzD,aAAa,GAAG,WAAW,CAAC,OAAO,IAAI,SAAS,CAAA;IACpD,CAAC;IAAC,MAAM,CAAC;QACL,iEAAiE;IACrE,CAAC;IAED,GAAG,CAAC,GAAG,WAAW,IAAI,aAAa,EAAE,CAAC,CAAA;AAC1C,CAAC","sourcesContent":["import { readFileSync } from 'node:fs'\nimport { dirname, join } from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nimport { packageName } from '../config.js'\nimport { out } from '../output.js'\n\n// Read at run time rather than baked in at build time, so it cannot drift from the version\n// actually installed. dist/cli/version.js sits two levels under the package root, both in\n// this repo and once published.\nexport function version(): void {\n const packageRoot = join(dirname(fileURLToPath(import.meta.url)), '..', '..')\n\n let versionNumber = 'unknown'\n try {\n const raw = readFileSync(join(packageRoot, 'package.json'), 'utf8')\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const packageJson: { version?: string } = JSON.parse(raw)\n versionNumber = packageJson.version ?? 'unknown'\n } catch {\n // reporting \"unknown\" beats failing to answer `--version` at all\n }\n\n out(`${packageName} ${versionNumber}`)\n}\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/cli/version.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAGlC,2FAA2F;AAC3F,0FAA0F;AAC1F,gCAAgC;AAChC,MAAM,UAAU,OAAO;IACnB,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IAE7E,IAAI,aAAa,GAAG,SAAS,CAAA;IAC7B,IAAI,CAAC;QACD,MAAM,GAAG,GAAG,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAA;QACnE,mEAAmE;QACnE,MAAM,WAAW,GAAyB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACzD,aAAa,GAAG,WAAW,CAAC,OAAO,IAAI,SAAS,CAAA;IACpD,CAAC;IAAC,MAAM,CAAC;QACL,iEAAiE;IACrE,CAAC;IAED,GAAG,CAAC,GAAG,WAAW,IAAI,aAAa,EAAE,CAAC,CAAA;AAC1C,CAAC","sourcesContent":["\nimport { readFileSync } from 'node:fs'\nimport { dirname, join } from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nimport { packageName } from '../config.js'\nimport { out } from '../output.js'\n\n\n// Read at run time rather than baked in at build time, so it cannot drift from the version\n// actually installed. dist/cli/version.js sits two levels under the package root, both in\n// this repo and once published.\nexport function version(): void {\n const packageRoot = join(dirname(fileURLToPath(import.meta.url)), '..', '..')\n\n let versionNumber = 'unknown'\n try {\n const raw = readFileSync(join(packageRoot, 'package.json'), 'utf8')\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const packageJson: { version?: string } = JSON.parse(raw)\n versionNumber = packageJson.version ?? 'unknown'\n } catch {\n // reporting \"unknown\" beats failing to answer `--version` at all\n }\n\n out(`${packageName} ${versionNumber}`)\n}\n"]}
@@ -1,2 +1,4 @@
1
+ export type StopFn = () => void;
1
2
  export declare function watch(): Promise<void>;
3
+ export declare function doWatch(): Promise<StopFn>;
2
4
  //# sourceMappingURL=watch.d.ts.map
package/dist/cli/watch.js CHANGED
@@ -9,6 +9,10 @@ import { makeRunManagerState } from './lib/makeWatchRunState.js';
9
9
  import { makeReRunManager } from './lib/reRunManager.js';
10
10
  import { alwaysCacheBust } from './lib/alwaysCacheBust.js';
11
11
  export async function watch() {
12
+ await doWatch();
13
+ await new Promise(() => { });
14
+ }
15
+ export async function doWatch() {
12
16
  const startTime = new Date().getTime();
13
17
  const { parseCommandLineArguments } = await import('./lib/parseCommandLineArguments.js');
14
18
  const allowedClArguments = {
@@ -52,6 +56,7 @@ export async function watch() {
52
56
  const runsOut = (agentMode) ? agentSilentOut : undefined;
53
57
  agentOut(chalk.brightblue `[${packageName}]...`);
54
58
  setEnv();
59
+ const stopFns = [];
55
60
  const { loadConfig } = await import('./lib/loadConfig.js');
56
61
  const userConfig = (typeof clArguments.config === 'string')
57
62
  ? await loadConfig(clArguments.config)
@@ -105,10 +110,11 @@ export async function watch() {
105
110
  // out. Registered here so it pairs with the setup above and covers the initial run too.
106
111
  const { doUserTeardown } = await import('./lib/doUserTeardown.js');
107
112
  const { registerShutdownHandlers } = await import('./lib/shutdown.js');
108
- registerShutdownHandlers(config, {
113
+ const unregisterShutdownHandlers = registerShutdownHandlers(config, {
109
114
  teardown: doUserTeardown,
110
115
  exit: code => process.exit(code)
111
116
  });
117
+ stopFns.push(unregisterShutdownHandlers);
112
118
  agentOut(chalk.brightblue(findingTestsMessage(config)));
113
119
  const { findTestFiles } = await import('./lib/findTestFiles.js');
114
120
  const testFiles = await findTestFiles(config);
@@ -124,8 +130,6 @@ export async function watch() {
124
130
  lastTestFiles: testFiles
125
131
  }), runsOut);
126
132
  process.setSourceMapsEnabled(true); // enable source mapping
127
- const { runTests } = await import('./lib/runTests.js');
128
- let initialTestRun = null;
129
133
  if (testFiles.size > 0) {
130
134
  agentOut(chalk.brightblue(foundTestsMessage(testFiles.size)));
131
135
  // the trees are only consulted to narrow a run, so with evaluation off building them
@@ -135,17 +139,32 @@ export async function watch() {
135
139
  agentOut(chalk.brightblue `finding initial dependency trees...`);
136
140
  dependencyTrees = await buildDependencyTrees(config, testFiles);
137
141
  }
142
+ }
143
+ // live before the first test runs, for two reasons. A change landing during the initial
144
+ // run (a compiler emit, typically) is seen rather than lost. And the watcher starts on a
145
+ // quiet loop: node-watch probes for native recursive support with a 200ms timeout, and a
146
+ // loop busy running tests fails the probe, so it falls back to a sync walk of every
147
+ // directory - which then starved the tests' own timers (a 10ms interval fired once in 45ms)
148
+ const { watchFilesAndRunTests } = await import('./lib/watchFilesAndRunTests.js');
149
+ const stopWatcher = await watchFilesAndRunTests(config,
150
+ //testFiles,
151
+ dependencyTrees, failingTests, // CHECK this should also be in state
152
+ reRunManager,
153
+ //watchRunState,
154
+ runsOut, executionFilters);
155
+ stopFns.push(stopWatcher);
156
+ const { runTests } = await import('./lib/runTests.js');
157
+ let initialTestRun = null;
158
+ if (testFiles.size > 0) {
138
159
  if (config.watch.runAllOnStartup) {
139
160
  agentOut(chalk.brightblue `running initial tests...`);
140
- initialTestRun = runTests(config, testFiles, reRunManager, concurrency, (alwaysCacheBust) ? 'refresh' : 'cached', runsOut, executionFilters).then(async (testsResult) => {
161
+ initialTestRun = runTests(config, testFiles, reRunManager, concurrency, (alwaysCacheBust) ? 'refresh' : 'cached', runsOut, executionFilters).then(testsResult => {
141
162
  const time = new Date().getTime() - startTime;
142
163
  //await new Promise((resolve) => setTimeout(resolve, 100))
143
164
  agentOut(chalk.grey `\n${time.toLocaleString()}ms`);
144
165
  return testsResult;
145
166
  });
146
167
  reRunManager.state.currentRun = initialTestRun;
147
- // do we need to catch errors like this?
148
- initialTestRun.catch(err => `Error during initial test run: ${err}`);
149
168
  }
150
169
  }
151
170
  else {
@@ -155,21 +174,27 @@ export async function watch() {
155
174
  const run = agentRunStart(config, 0);
156
175
  agentDone(config, run, statusCodes.couldNotRun, 'no test files found', null, new Date().getTime() - startTime, 0);
157
176
  }
158
- const { watchFilesAndRunTests } = await import('./lib/watchFilesAndRunTests.js');
159
- await watchFilesAndRunTests(config,
160
- //testFiles,
161
- dependencyTrees, failingTests, // CHECK this should also be in state
162
- reRunManager,
163
- //watchRunState,
164
- runsOut, executionFilters);
177
+ // announced once the initial run is over, so `watching` marks a real milestone: startup is
178
+ // complete and the watcher is live. A failed run is reported by listenToUser below.
179
+ if (initialTestRun !== null)
180
+ await initialTestRun.catch(() => null);
165
181
  agentOut(chalk.brightblue `watching...`);
166
182
  agentWatching(config, testFiles.size);
167
183
  const { listenToUser } = await import('./lib/listenToUser.js');
168
- listenToUser(reRunManager, files => () => {
184
+ const disposeTty = listenToUser(reRunManager, files => () => {
169
185
  return runTests(config, files, reRunManager, concurrency, 'refresh', runsOut, executionFilters);
170
- }, config.watch.ttyActionsOnKeypress, initialTestRun, process.stdin, runsOut).catch(e => { throw e; });
171
- // park forever - watch mode ends by being signalled, and the shutdown handlers registered
172
- // above run the user's teardown on the way out
173
- await new Promise(() => { });
186
+ }, config.watch.ttyActionsOnKeypress, initialTestRun, process.stdin, runsOut);
187
+ stopFns.push(disposeTty);
188
+ const dispose = () => {
189
+ for (const stop of stopFns) {
190
+ stop();
191
+ }
192
+ stopFns.length = 0; // Idempotencize
193
+ };
194
+ return dispose;
195
+ // (async () => {
196
+ // await new Promise<void>(() => {})
197
+ // })()
198
+ //await new Promise<void>(() => {})
174
199
  }
175
200
  //# sourceMappingURL=watch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"watch.js","sourceRoot":"","sources":["../../src/cli/watch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,sBAAsB,CAAA;AAExC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAGzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,C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KAAK,EACb,OAAO,CACV,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,CAAA,CAAC,CAAC,CAAC,CAAA;IAGzB,0FAA0F;IAC1F,+CAA+C;IAC/C,MAAM,IAAI,OAAO,CAAO,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;AACrC,CAAC","sourcesContent":["import chalk from '../packages/chalk.js'\n\nimport { packageName } from '../config.js'\nimport { out, debug } from '../output.js'\n\nimport type { AllowedArguments, DependencyTrees, OutFn } from '../types.js'\nimport { setEnv } from './lib/setEnv.js'\nimport { findingTestsMessage } from './lib/findingTestsMessage.js'\nimport { foundTestsMessage } from './lib/foundTestsMessage.js'\n//import { isTest } from './lib/isTest.js'\nimport { makeRunManagerState } from './lib/makeWatchRunState.js'\nimport { makeReRunManager } from './lib/reRunManager.js'\nimport { alwaysCacheBust } from './lib/alwaysCacheBust.js'\nimport { Concurrency } from './lib/runTests.js'\n\nexport async function watch(): Promise<void> {\n const startTime = new Date().getTime()\n\n const { parseCommandLineArguments } = await import('./lib/parseCommandLineArguments.js')\n const allowedClArguments: AllowedArguments = {\n 'config': {\n flag: 'c',\n hasValue: true\n },\n 'test-files': {\n flag: 't',\n hasValue: true\n },\n 'filter': {\n flag: 'f',\n hasValue: true\n },\n 'filter-it': {\n flag: 'i',\n hasValue: true\n },\n 'filter-describe': {\n flag: 'd',\n hasValue: true\n },\n 'status-file': {\n flag: 's',\n hasValue: true\n },\n 'agent': {\n hasValue: false\n }\n }\n const clArguments = parseCommandLineArguments(allowedClArguments)\n //debug('clArguments', clArguments)\n\n // agent mode owns stdout, so the banner and every later message below is routed through\n // agentOut - a sink when the flag is on. Announced before the config loads, so a reader\n // sees the process is alive even if startup is slow.\n const agentMode = clArguments.agent === true\n const {\n agentInit, agentFound, agentRunStart, agentDone, agentWatching, agentSilentOut\n } = await import('./lib/agentReport.js')\n agentInit(agentMode)\n const agentOut: OutFn = (agentMode) ? agentSilentOut : out\n const runsOut = (agentMode) ? agentSilentOut : undefined\n\n agentOut(chalk.brightblue`[${packageName}]...`)\n\n setEnv()\n\n const { loadConfig } = await import('./lib/loadConfig.js')\n const userConfig = (typeof clArguments.config === 'string')\n ? await loadConfig(clArguments.config)\n : await loadConfig()\n\n if ('test-files' in clArguments) {\n const testFilesPattern = clArguments['test-files']\n if (typeof testFilesPattern !== 'string' || testFilesPattern === '') {\n throw new Error('No pattern specified for --test-files or -t argument')\n }\n userConfig.tests = testFilesPattern\n }\n\n if ('filter' in clArguments) {\n const filter = clArguments.filter\n if (typeof filter !== 'string' || filter === '') {\n throw new Error('No pattern specified for --filter or -f argument')\n }\n userConfig.testsFilter = filter\n }\n\n if ('status-file' in clArguments) {\n const statusFile = clArguments['status-file']\n if (typeof statusFile !== 'string' || statusFile === '') {\n throw new Error('No file path specified for --status-file or -s argument')\n }\n userConfig.watch = { ...userConfig.watch, statusFile }\n }\n\n const filterIt = clArguments['filter-it']\n const filterDescribe = clArguments['filter-describe']\n if (filterIt === true || filterIt === '') throw new Error('No substring specified for --filter-it')\n if (filterDescribe === true || filterDescribe === '') {\n throw new Error('No substring specified for --filter-describe')\n }\n const executionFilters = { it: filterIt, describe: filterDescribe }\n\n const { applyConfigDefaults } = await import('./lib/applyConfigDefaults.js')\n const config = applyConfigDefaults(userConfig)\n if (agentMode) config.watch.agent = true\n // there is no watch flag for it, and a config file must not enable it here: a truncated\n // run would still report covers=all, and failing files would drop out of `failing`\n config.failFast = false\n\n // not silenced in agent mode - a config error is fatal, so losing the message is worse\n // than breaking the one-line-per-event contract\n const { validateConfig } = await import('./lib/validateConfig.js')\n validateConfig(config)\n\n // no run has finished yet, so the status file starts at -1 rather than stale\n const { resetStatusFile, statusCodes, writeStatusFile } = await import('./lib/statusFile.js')\n resetStatusFile(config)\n\n const { doUserSetup } = await import('./lib/doUserSetup.js')\n await doUserSetup(config, agentOut)\n\n // watch mode never reaches an end of its own, so teardown only gets a chance on the way\n // out. Registered here so it pairs with the setup above and covers the initial run too.\n const { doUserTeardown } = await import('./lib/doUserTeardown.js')\n const { registerShutdownHandlers } = await import('./lib/shutdown.js')\n registerShutdownHandlers(config, {\n teardown: doUserTeardown,\n exit: code => process.exit(code)\n })\n\n agentOut(chalk.brightblue(findingTestsMessage(config)))\n const { findTestFiles } = await import('./lib/findTestFiles.js')\n const testFiles = await findTestFiles(config)\n debug(testFiles)\n agentFound(config, testFiles.size)\n\n // global store of the dependencies of tests\n let dependencyTrees: DependencyTrees = {}\n // store failing tests so we can re-run them.\n const failingTests: string[] = []\n \n const concurrency: Concurrency = { limit: -1 }\n\n const reRunManager = makeReRunManager(\n null,\n makeRunManagerState({\n allTestFiles: testFiles,\n lastTestFiles: testFiles\n }),\n runsOut\n )\n\n process.setSourceMapsEnabled(true) // enable source mapping\n\n const { runTests } = await import('./lib/runTests.js')\n let initialTestRun: Promise<boolean | null> | null = null\n if (testFiles.size > 0) {\n agentOut(chalk.brightblue(foundTestsMessage(testFiles.size)))\n\n // the trees are only consulted to narrow a run, so with evaluation off building them\n // is pure cost - and it is the slowest part of startup on a large suite\n if (config.watch.dependencyEvaluation) {\n const { buildDependencyTrees } = await import('./lib/buildDependencyTrees.js')\n agentOut(chalk.brightblue`finding initial dependency trees...`)\n dependencyTrees = await buildDependencyTrees(config, testFiles)\n }\n\n if (config.watch.runAllOnStartup) {\n agentOut(chalk.brightblue`running initial tests...`)\n initialTestRun = runTests(\n config, testFiles,\n reRunManager,\n concurrency,\n (alwaysCacheBust) ? 'refresh' : 'cached',\n runsOut, executionFilters\n ).then(async testsResult => {\n const time = new Date().getTime() - startTime\n //await new Promise((resolve) => setTimeout(resolve, 100))\n agentOut(chalk.grey`\\n${time.toLocaleString()}ms`)\n return testsResult\n })\n reRunManager.state.currentRun = initialTestRun\n // do we need to catch errors like this?\n initialTestRun.catch(err => `Error during initial test run: ${err}`)\n }\n } else {\n agentOut(chalk.orange`no test files found`)\n writeStatusFile(config, statusCodes.couldNotRun, 'no test files found')\n // still reported as a run, so a reader waiting on a done line always gets one\n const run = agentRunStart(config, 0)\n agentDone(\n config, run, statusCodes.couldNotRun, 'no test files found',\n null, new Date().getTime() - startTime, 0\n )\n }\n\n const { watchFilesAndRunTests } = await import('./lib/watchFilesAndRunTests.js')\n await watchFilesAndRunTests(\n config,\n //testFiles,\n dependencyTrees,\n failingTests, // CHECK this should also be in state\n reRunManager,\n //watchRunState,\n runsOut,\n executionFilters\n )\n\n\n agentOut(chalk.brightblue`watching...`)\n agentWatching(config, testFiles.size)\n\n const { listenToUser } = await import('./lib/listenToUser.js')\n listenToUser(\n reRunManager,\n files => () => {\n return runTests(config, files, reRunManager, concurrency, 'refresh', runsOut, executionFilters)\n },\n config.watch.ttyActionsOnKeypress,\n initialTestRun,\n process.stdin,\n runsOut\n ).catch(e => { throw e })\n\n\n // park forever - watch mode ends by being signalled, and the shutdown handlers registered\n // above run the user's teardown on the way out\n await new Promise<void>(() => {})\n}\n"]}
1
+ {"version":3,"file":"watch.js","sourceRoot":"","sources":["../../src/cli/watch.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,sBAAsB,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,0CAA0C;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAK1D,MAAM,CAAC,KAAK,UAAU,KAAK;IACvB,MAAM,OAAO,EAAE,CAAA;IACf,MAAM,IAAI,OAAO,CAAO,GAAG,EAAE,GAAE,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AAgB,CAAC,CAAA;IACnG,CAAC,EACD,MAAM,CAAC,KAAK,CAAC,oBAAoB,EACjC,cAAc,EACd,OAAO,CAAC,KAAK,EACb,OAAO,CACV,CAAA;IACD,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IAExB,MAAM,OAAO,GAAG,GAAG,EAAE;QACjB,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;YACzB,IAAI,EAAE,CAAA;QACV,CAAC;QACD,OAAO,CAAC,MAAM,GAAG,CAAC,CAAA,CAAC,gBAAgB;IACvC,CAAC,CAAA;IACD,OAAO,OAAO,CAAA;IAGd,iBAAiB;IACjB,wCAAwC;IACxC,OAAO;IACP,mCAAmC;AACvC,CAAC","sourcesContent":["\nimport type { DependencyTrees, OutFn } from '../types.js'\nimport type { AllowedArguments } from './cliTypes.js'\nimport type { Concurrency } from './lib/runTests.js'\nimport chalk from '../packages/chalk.js'\nimport { packageName } from '../config.js'\nimport { out, debug } from '../output.js'\nimport { setEnv } from './lib/setEnv.js'\nimport { findingTestsMessage } from './lib/findingTestsMessage.js'\nimport { foundTestsMessage } from './lib/foundTestsMessage.js'\n//import { isTest } from './lib/isTest.js'\nimport { makeRunManagerState } from './lib/makeWatchRunState.js'\nimport { makeReRunManager } from './lib/reRunManager.js'\nimport { alwaysCacheBust } from './lib/alwaysCacheBust.js'\n\n\nexport type StopFn = () => void\n\nexport async function watch(): Promise<void> {\n await doWatch()\n await new Promise<void>(() => {})\n}\n\nexport async function doWatch(): Promise<StopFn> {\n const startTime = new Date().getTime()\n\n const { parseCommandLineArguments } = await import('./lib/parseCommandLineArguments.js')\n const allowedClArguments: AllowedArguments = {\n 'config': {\n flag: 'c',\n hasValue: true\n },\n 'test-files': {\n flag: 't',\n hasValue: true\n },\n 'filter': {\n flag: 'f',\n hasValue: true\n },\n 'filter-it': {\n flag: 'i',\n hasValue: true\n },\n 'filter-describe': {\n flag: 'd',\n hasValue: true\n },\n 'status-file': {\n flag: 's',\n hasValue: true\n },\n 'agent': {\n hasValue: false\n }\n }\n const clArguments = parseCommandLineArguments(allowedClArguments)\n //debug('clArguments', clArguments)\n\n // agent mode owns stdout, so the banner and every later message below is routed through\n // agentOut - a sink when the flag is on. Announced before the config loads, so a reader\n // sees the process is alive even if startup is slow.\n const agentMode = clArguments.agent === true\n const {\n agentInit, agentFound, agentRunStart, agentDone, agentWatching, agentSilentOut\n } = await import('./lib/agentReport.js')\n agentInit(agentMode)\n const agentOut: OutFn = (agentMode) ? agentSilentOut : out\n const runsOut = (agentMode) ? agentSilentOut : undefined\n\n agentOut(chalk.brightblue`[${packageName}]...`)\n\n setEnv()\n\n const stopFns: StopFn[] = []\n\n const { loadConfig } = await import('./lib/loadConfig.js')\n const userConfig = (typeof clArguments.config === 'string')\n ? await loadConfig(clArguments.config)\n : await loadConfig()\n\n if ('test-files' in clArguments) {\n const testFilesPattern = clArguments['test-files']\n if (typeof testFilesPattern !== 'string' || testFilesPattern === '') {\n throw new Error('No pattern specified for --test-files or -t argument')\n }\n userConfig.tests = testFilesPattern\n }\n\n if ('filter' in clArguments) {\n const filter = clArguments.filter\n if (typeof filter !== 'string' || filter === '') {\n throw new Error('No pattern specified for --filter or -f argument')\n }\n userConfig.testsFilter = filter\n }\n\n if ('status-file' in clArguments) {\n const statusFile = clArguments['status-file']\n if (typeof statusFile !== 'string' || statusFile === '') {\n throw new Error('No file path specified for --status-file or -s argument')\n }\n userConfig.watch = { ...userConfig.watch, statusFile }\n }\n\n const filterIt = clArguments['filter-it']\n const filterDescribe = clArguments['filter-describe']\n if (filterIt === true || filterIt === '') throw new Error('No substring specified for --filter-it')\n if (filterDescribe === true || filterDescribe === '') {\n throw new Error('No substring specified for --filter-describe')\n }\n const executionFilters = { it: filterIt, describe: filterDescribe }\n\n const { applyConfigDefaults } = await import('./lib/applyConfigDefaults.js')\n const config = applyConfigDefaults(userConfig)\n if (agentMode) config.watch.agent = true\n // there is no watch flag for it, and a config file must not enable it here: a truncated\n // run would still report covers=all, and failing files would drop out of `failing`\n config.failFast = false\n\n // not silenced in agent mode - a config error is fatal, so losing the message is worse\n // than breaking the one-line-per-event contract\n const { validateConfig } = await import('./lib/validateConfig.js')\n validateConfig(config)\n\n // no run has finished yet, so the status file starts at -1 rather than stale\n const { resetStatusFile, statusCodes, writeStatusFile } = await import('./lib/statusFile.js')\n resetStatusFile(config)\n\n const { doUserSetup } = await import('./lib/doUserSetup.js')\n await doUserSetup(config, agentOut)\n\n // watch mode never reaches an end of its own, so teardown only gets a chance on the way\n // out. Registered here so it pairs with the setup above and covers the initial run too.\n const { doUserTeardown } = await import('./lib/doUserTeardown.js')\n const { registerShutdownHandlers } = await import('./lib/shutdown.js')\n \n const unregisterShutdownHandlers = registerShutdownHandlers(config, {\n teardown: doUserTeardown,\n exit: code => process.exit(code)\n })\n stopFns.push(unregisterShutdownHandlers)\n\n agentOut(chalk.brightblue(findingTestsMessage(config)))\n const { findTestFiles } = await import('./lib/findTestFiles.js')\n const testFiles = await findTestFiles(config)\n debug(testFiles)\n agentFound(config, testFiles.size)\n\n // global store of the dependencies of tests\n let dependencyTrees: DependencyTrees = {}\n // store failing tests so we can re-run them.\n const failingTests: string[] = []\n \n const concurrency: Concurrency = { limit: -1 }\n\n const reRunManager = makeReRunManager(\n null,\n makeRunManagerState({\n allTestFiles: testFiles,\n lastTestFiles: testFiles\n }),\n runsOut\n )\n\n process.setSourceMapsEnabled(true) // enable source mapping\n\n if (testFiles.size > 0) {\n agentOut(chalk.brightblue(foundTestsMessage(testFiles.size)))\n\n // the trees are only consulted to narrow a run, so with evaluation off building them\n // is pure cost - and it is the slowest part of startup on a large suite\n if (config.watch.dependencyEvaluation) {\n const { buildDependencyTrees } = await import('./lib/buildDependencyTrees.js')\n agentOut(chalk.brightblue`finding initial dependency trees...`)\n dependencyTrees = await buildDependencyTrees(config, testFiles)\n }\n }\n\n // live before the first test runs, for two reasons. A change landing during the initial\n // run (a compiler emit, typically) is seen rather than lost. And the watcher starts on a\n // quiet loop: node-watch probes for native recursive support with a 200ms timeout, and a\n // loop busy running tests fails the probe, so it falls back to a sync walk of every\n // directory - which then starved the tests' own timers (a 10ms interval fired once in 45ms)\n const { watchFilesAndRunTests } = await import('./lib/watchFilesAndRunTests.js')\n const stopWatcher = await watchFilesAndRunTests(\n config,\n //testFiles,\n dependencyTrees,\n failingTests, // CHECK this should also be in state\n reRunManager,\n //watchRunState,\n runsOut,\n executionFilters\n )\n stopFns.push(stopWatcher)\n\n const { runTests } = await import('./lib/runTests.js')\n let initialTestRun: Promise<boolean | null> | null = null\n if (testFiles.size > 0) {\n if (config.watch.runAllOnStartup) {\n agentOut(chalk.brightblue`running initial tests...`)\n initialTestRun = runTests(\n config, testFiles,\n reRunManager,\n concurrency,\n (alwaysCacheBust) ? 'refresh' : 'cached',\n runsOut, executionFilters\n ).then(testsResult => {\n const time = new Date().getTime() - startTime\n //await new Promise((resolve) => setTimeout(resolve, 100))\n agentOut(chalk.grey`\\n${time.toLocaleString()}ms`)\n return testsResult\n })\n reRunManager.state.currentRun = initialTestRun\n }\n } else {\n agentOut(chalk.orange`no test files found`)\n writeStatusFile(config, statusCodes.couldNotRun, 'no test files found')\n // still reported as a run, so a reader waiting on a done line always gets one\n const run = agentRunStart(config, 0)\n agentDone(\n config, run, statusCodes.couldNotRun, 'no test files found',\n null, new Date().getTime() - startTime, 0\n )\n }\n\n // announced once the initial run is over, so `watching` marks a real milestone: startup is\n // complete and the watcher is live. A failed run is reported by listenToUser below.\n if (initialTestRun !== null) await initialTestRun.catch(() => null)\n\n agentOut(chalk.brightblue`watching...`)\n agentWatching(config, testFiles.size)\n\n const { listenToUser } = await import('./lib/listenToUser.js')\n const disposeTty = listenToUser(\n reRunManager,\n files => () => {\n return runTests(config, files, reRunManager, concurrency, 'refresh', runsOut, executionFilters)\n },\n config.watch.ttyActionsOnKeypress,\n initialTestRun,\n process.stdin,\n runsOut\n )\n stopFns.push(disposeTty)\n\n const dispose = () => {\n for (const stop of stopFns) {\n stop()\n }\n stopFns.length = 0 // Idempotencize\n }\n return dispose\n\n\n // (async () => {\n // await new Promise<void>(() => {})\n // })()\n //await new Promise<void>(() => {})\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAA;AAE5C,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAA;AAE7B,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,aAAa,EAAE,wBAAwB,CAAC,CAAA;AACxE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA,CAAC,2DAA2D;AAEzG,oBAAoB;AACpB,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAA;AAE9B,sEAAsE;AACtE,6EAA6E;AAC7E,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA","sourcesContent":["import { envFlag } from './envFlag.js'\n\nexport const packageName = 'sxy-test-runner'\n\nexport const cliName = 'sxyt'\n\nexport const configFileNames = ['sxyt.config', 'sxy-test-runner.config']\nexport const configLocations = ['', 'config'] // locations where the configs may be placed in proj folder\n\n// used in output.ts\nexport const debugging = false\n\n// Toggle per-phase timing output with the SXYT_TIME_PROFILING env var\n// (SXYT_TIME_PROFILING=true | 1). Defaults to off so normal runs stay clean.\nexport const showTimeProfiling = envFlag(process.env.SXYT_TIME_PROFILING)\n"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGtC,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAA;AAE5C,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAA;AAE7B,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,aAAa,EAAE,wBAAwB,CAAC,CAAA;AACxE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA,CAAC,2DAA2D;AAEzG,oBAAoB;AACpB,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAA;AAE9B,sEAAsE;AACtE,6EAA6E;AAC7E,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA","sourcesContent":["\nimport { envFlag } from './envFlag.js'\n\n\nexport const packageName = 'sxy-test-runner'\n\nexport const cliName = 'sxyt'\n\nexport const configFileNames = ['sxyt.config', 'sxy-test-runner.config']\nexport const configLocations = ['', 'config'] // locations where the configs may be placed in proj folder\n\n// used in output.ts\nexport const debugging = false\n\n// Toggle per-phase timing output with the SXYT_TIME_PROFILING env var\n// (SXYT_TIME_PROFILING=true | 1). Defaults to off so normal runs stay clean.\nexport const showTimeProfiling = envFlag(process.env.SXYT_TIME_PROFILING)\n"]}
package/dist/describe.js CHANGED
@@ -18,7 +18,7 @@ export function describe(theThing, testsOrMeta, possiblyTests) {
18
18
  else {
19
19
  checkMeta(`describe('${theThing}')`, testsOrMeta, ['parallelTests', 'sequentialTests']);
20
20
  meta = testsOrMeta;
21
- tests = possiblyTests; // eslint-disable-line no-type-assertion/no-type-assertion
21
+ tests = possiblyTests; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
22
22
  }
23
23
  global.__sxy_test_runner__.describes.push({
24
24
  counter: thisDescribeCounter,
@@ -1 +1 @@
1
- {"version":3,"file":"describe.js","sourceRoot":"","sources":["../src/describe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,qBAAqB,CAAA;AAEvC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAOnC,MAAM,UAAU,QAAQ,CACpB,QAAgB,EAAE,WAA4C,EAAE,aAAgC;IAEhG,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CACX,oFAAoF;cAClF,0DAA0D;cAC1D,+CAA+C,CACpD,CAAA;QACD,gFAAgF;IACpF,CAAC;IAED,MAAM,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC,eAAe,CAAA;IACtE,MAAM,CAAC,mBAAmB,CAAC,eAAe,EAAE,CAAA;IAE5C,IAAI,IAAI,GAAG,SAAS,CAAA;IACpB,IAAI,KAAK,CAAA;IACT,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE,CAAC;QACpC,KAAK,GAAG,WAAW,CAAA;IACvB,CAAC;SAAM,CAAC;QACJ,SAAS,CAAC,aAAa,QAAQ,IAAI,EAAE,WAAW,EAAE,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC,CAAA;QACvF,IAAI,GAAG,WAAW,CAAA;QAClB,KAAK,GAAG,aAAiC,CAAA,CAAC,0DAA0D;IACxG,CAAC;IACD,MAAM,CAAC,mBAAmB,CAAC,SAAS,CAAC,IAAI,CAAC;QACtC,OAAO,EAAE,mBAAmB;QAC5B,KAAK,EAAE,QAAQ;QACf,IAAI;QACJ,KAAK;KACR,CAAC,CAAA;IAEF,KAAK,CACD,KAAK,CAAC,SAAS,CAAA,GAAG,mBAAmB,GAAG;UAClC,KAAK,CAAC,SAAS,CAAA,aAAa,GAAG,KAAK,CAAC,UAAU,CAAA,GAAG,QAAQ,IAAI,CACvE,CAAA;AACL,CAAC","sourcesContent":["import chalk from './packages/chalk.js'\n\nimport { checkMeta } from './checkMeta.js'\nimport { debug } from './output.js'\nimport type { DescribeCallback } from './types.js'\n\nexport type DescribeMeta = { parallelTests: boolean } | { sequentialTests: boolean }\n\nexport function describe(theThing: string, tests: DescribeCallback): void;\nexport function describe(theThing: string, meta: DescribeMeta, tests: DescribeCallback): void;\nexport function describe(\n theThing: string, testsOrMeta: DescribeCallback | DescribeMeta, possiblyTests?: DescribeCallback\n): void {\n if (!global.__sxy_test_runner__) {\n throw new Error(\n 'sxy-test-runner describe() was called, but the test framework has not initialized.'\n + ' This might be because you have run a test file directly'\n + ', instead of running \\'pnpm sxy-test-runner\\''\n )\n // todo - maybe we can initialise the framework and just run only this test file\n }\n\n const thisDescribeCounter = global.__sxy_test_runner__.describeCounter\n global.__sxy_test_runner__.describeCounter++\n\n let meta = undefined\n let tests\n if (typeof testsOrMeta === 'function') {\n tests = testsOrMeta\n } else {\n checkMeta(`describe('${theThing}')`, testsOrMeta, ['parallelTests', 'sequentialTests'])\n meta = testsOrMeta\n tests = possiblyTests as DescribeCallback // eslint-disable-line no-type-assertion/no-type-assertion\n }\n global.__sxy_test_runner__.describes.push({\n counter: thisDescribeCounter,\n thing: theThing,\n meta,\n tests\n })\n\n debug(\n chalk.lightgrey`${thisDescribeCounter})`\n + chalk.lightgrey` Done with ` + chalk.brightblue`${theThing}\\n`\n )\n}\n"]}
1
+ {"version":3,"file":"describe.js","sourceRoot":"","sources":["../src/describe.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,qBAAqB,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAOnC,MAAM,UAAU,QAAQ,CACpB,QAAgB,EAAE,WAA4C,EAAE,aAAgC;IAEhG,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CACX,oFAAoF;cAClF,0DAA0D;cAC1D,+CAA+C,CACpD,CAAA;QACD,gFAAgF;IACpF,CAAC;IAED,MAAM,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC,eAAe,CAAA;IACtE,MAAM,CAAC,mBAAmB,CAAC,eAAe,EAAE,CAAA;IAE5C,IAAI,IAAI,GAAG,SAAS,CAAA;IACpB,IAAI,KAAK,CAAA;IACT,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE,CAAC;QACpC,KAAK,GAAG,WAAW,CAAA;IACvB,CAAC;SAAM,CAAC;QACJ,SAAS,CAAC,aAAa,QAAQ,IAAI,EAAE,WAAW,EAAE,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC,CAAA;QACvF,IAAI,GAAG,WAAW,CAAA;QAClB,KAAK,GAAG,aAAiC,CAAA,CAAC,kEAAkE;IAChH,CAAC;IACD,MAAM,CAAC,mBAAmB,CAAC,SAAS,CAAC,IAAI,CAAC;QACtC,OAAO,EAAE,mBAAmB;QAC5B,KAAK,EAAE,QAAQ;QACf,IAAI;QACJ,KAAK;KACR,CAAC,CAAA;IAEF,KAAK,CACD,KAAK,CAAC,SAAS,CAAA,GAAG,mBAAmB,GAAG;UAClC,KAAK,CAAC,SAAS,CAAA,aAAa,GAAG,KAAK,CAAC,UAAU,CAAA,GAAG,QAAQ,IAAI,CACvE,CAAA;AACL,CAAC","sourcesContent":["\nimport type { DescribeCallback } from './types.js'\nimport chalk from './packages/chalk.js'\nimport { checkMeta } from './checkMeta.js'\nimport { debug } from './output.js'\n\n\nexport type DescribeMeta = { parallelTests: boolean } | { sequentialTests: boolean }\n\nexport function describe(theThing: string, tests: DescribeCallback): void\nexport function describe(theThing: string, meta: DescribeMeta, tests: DescribeCallback): void\nexport function describe(\n theThing: string, testsOrMeta: DescribeCallback | DescribeMeta, possiblyTests?: DescribeCallback\n): void {\n if (!global.__sxy_test_runner__) {\n throw new Error(\n 'sxy-test-runner describe() was called, but the test framework has not initialized.'\n + ' This might be because you have run a test file directly'\n + ', instead of running \\'pnpm sxy-test-runner\\''\n )\n // todo - maybe we can initialise the framework and just run only this test file\n }\n\n const thisDescribeCounter = global.__sxy_test_runner__.describeCounter\n global.__sxy_test_runner__.describeCounter++\n\n let meta = undefined\n let tests\n if (typeof testsOrMeta === 'function') {\n tests = testsOrMeta\n } else {\n checkMeta(`describe('${theThing}')`, testsOrMeta, ['parallelTests', 'sequentialTests'])\n meta = testsOrMeta\n tests = possiblyTests as DescribeCallback // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion\n }\n global.__sxy_test_runner__.describes.push({\n counter: thisDescribeCounter,\n thing: theThing,\n meta,\n tests\n })\n\n debug(\n chalk.lightgrey`${thisDescribeCounter})`\n + chalk.lightgrey` Done with ` + chalk.brightblue`${theThing}\\n`\n )\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"indexNumberToLetters.js","sourceRoot":"","sources":["../src/indexNumberToLetters.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,oBAAoB,CAAC,MAAc,EAAE,SAAS,GAAG,KAAK;IAClE,MAAM,aAAa,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IACzC,IAAI,IAAI,GAAG,EAAE,CAAA;IACb,IAAI,WAAmB,CAAA;IAEvB,OAAO,MAAM,GAAG,CAAC,EAAE,CAAC;QAChB,WAAW,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,CAAA;QAC/B,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,aAAa,GAAG,WAAW,CAAC,GAAG,IAAI,CAAA;QAC9D,MAAM,GAAG,CAAC,CAAC,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;IAC9C,CAAC;IACD,OAAO,IAAI,IAAI,SAAS,CAAA;AAC5B,CAAC","sourcesContent":["export function indexNumberToLetters(number: number, uppercase = false): string | undefined {\n const charCodeStart = uppercase ? 65 : 97\n let text = ''\n let letterIndex: number\n\n while (number > 0) {\n letterIndex = (number - 1) % 26\n text = String.fromCharCode(charCodeStart + letterIndex) + text\n number = ((number - letterIndex) / 26) | 0\n }\n return text || undefined\n}\n"]}
1
+ {"version":3,"file":"indexNumberToLetters.js","sourceRoot":"","sources":["../src/indexNumberToLetters.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,oBAAoB,CAAC,MAAc,EAAE,SAAS,GAAG,KAAK;IAClE,MAAM,aAAa,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IACzC,IAAI,IAAI,GAAG,EAAE,CAAA;IACb,IAAI,WAAmB,CAAA;IAEvB,OAAO,MAAM,GAAG,CAAC,EAAE,CAAC;QAChB,WAAW,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,CAAA;QAC/B,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,aAAa,GAAG,WAAW,CAAC,GAAG,IAAI,CAAA;QAC9D,MAAM,GAAG,CAAC,CAAC,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;IAC9C,CAAC;IACD,OAAO,IAAI,IAAI,SAAS,CAAA;AAC5B,CAAC","sourcesContent":["\nexport function indexNumberToLetters(number: number, uppercase = false): string | undefined {\n const charCodeStart = uppercase ? 65 : 97\n let text = ''\n let letterIndex: number\n\n while (number > 0) {\n letterIndex = (number - 1) % 26\n text = String.fromCharCode(charCodeStart + letterIndex) + text\n number = ((number - letterIndex) / 26) | 0\n }\n return text || undefined\n}\n"]}
package/dist/meta.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"meta.js","sourceRoot":"","sources":["../src/meta.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAM1C,MAAM,UAAU,IAAI,CAAC,OAAiB;IAClC,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CACX,gFAAgF;cAC9E,0DAA0D;cAC1D,+CAA+C,CACpD,CAAA;IACL,CAAC;IAED,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,mBAAmB,EAAE,qBAAqB,CAAC,CAAC,CAAA;IAE1E,MAAM,CAAC,mBAAmB,CAAC,QAAQ,GAAG,OAAO,CAAA;AACjD,CAAC","sourcesContent":["\nimport { checkMeta } from './checkMeta.js'\n\nexport type FileMeta\n = { parallelDescribes: boolean }\n | { sequentialDescribes: boolean }\n\nexport function meta(theMeta: FileMeta): void {\n if (!global.__sxy_test_runner__) {\n throw new Error(\n 'sxy-test-runner meta() was called, but the test framework has not initialized.'\n + ' This might be because you have run a test file directly'\n + ', instead of running \\'pnpm sxy-test-runner\\''\n )\n }\n\n checkMeta('meta()', theMeta, ['parallelDescribes', 'sequentialDescribes'])\n\n global.__sxy_test_runner__.fileMeta = theMeta\n}\n"]}
1
+ {"version":3,"file":"meta.js","sourceRoot":"","sources":["../src/meta.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAO1C,MAAM,UAAU,IAAI,CAAC,OAAiB;IAClC,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CACX,gFAAgF;cAC9E,0DAA0D;cAC1D,+CAA+C,CACpD,CAAA;IACL,CAAC;IAED,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,mBAAmB,EAAE,qBAAqB,CAAC,CAAC,CAAA;IAE1E,MAAM,CAAC,mBAAmB,CAAC,QAAQ,GAAG,OAAO,CAAA;AACjD,CAAC","sourcesContent":["\nimport { checkMeta } from './checkMeta.js'\n\n\nexport type FileMeta\n = { parallelDescribes: boolean }\n | { sequentialDescribes: boolean }\n\nexport function meta(theMeta: FileMeta): void {\n if (!global.__sxy_test_runner__) {\n throw new Error(\n 'sxy-test-runner meta() was called, but the test framework has not initialized.'\n + ' This might be because you have run a test file directly'\n + ', instead of running \\'pnpm sxy-test-runner\\''\n )\n }\n\n checkMeta('meta()', theMeta, ['parallelDescribes', 'sequentialDescribes'])\n\n global.__sxy_test_runner__.fileMeta = theMeta\n}\n"]}
package/dist/output.js CHANGED
@@ -5,9 +5,11 @@ export function out(...texts) {
5
5
  }
6
6
  export function warn(...texts) {
7
7
  console.log(...texts);
8
+ //console.error(...texts)
8
9
  }
9
10
  export function error(...texts) {
10
11
  console.log(...texts);
12
+ //console.error(...texts)
11
13
  }
12
14
  export function log(...texts) {
13
15
  console.log(...texts);
@@ -1 +1 @@
1
- {"version":3,"file":"output.js","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,MAAM,UAAU,GAAG,CAAC,GAAG,KAAgB;IACnC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAA;AACzB,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,GAAG,KAAgB;IACpC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAA;AACzB,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,GAAG,KAAgB;IACrC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAA;AACzB,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,GAAG,KAAgB;IACnC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAA;AACzB,CAAC;AAED,MAAM,CAAC,MAAM,KAAK,GAAkC,CAAC,SAAS,CAAC;IAC3D,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,KAAgB;QAChC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAA;IACzB,CAAC;IACD,CAAC,CAAC,SAAS,KAAK;QACZ,mCAAmC;IACvC,CAAC,CAAA","sourcesContent":["/* eslint-disable no-console */\n\nimport { debugging } from './config.js'\n\nexport function out(...texts: unknown[]): void {\n console.log(...texts)\n}\n\nexport function warn(...texts: unknown[]): void {\n console.log(...texts)\n}\n\nexport function error(...texts: unknown[]): void {\n console.log(...texts)\n}\n\nexport function log(...texts: unknown[]): void {\n console.log(...texts)\n}\n\nexport const debug: (...texts: unknown[]) => void = (debugging)\n ? function debug(...texts: unknown[]) {\n console.log(...texts)\n }\n : function debug() {\n // no-op when debugging is disabled\n }\n"]}
1
+ {"version":3,"file":"output.js","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AACA,+BAA+B;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAGvC,MAAM,UAAU,GAAG,CAAC,GAAG,KAAgB;IACnC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAA;AACzB,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,GAAG,KAAgB;IACpC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAA;IACrB,yBAAyB;AAC7B,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,GAAG,KAAgB;IACrC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAA;IACrB,yBAAyB;AAC7B,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,GAAG,KAAgB;IACnC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAA;AACzB,CAAC;AAED,MAAM,CAAC,MAAM,KAAK,GAAkC,CAAC,SAAS,CAAC;IAC3D,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,KAAgB;QAChC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAA;IACzB,CAAC;IACD,CAAC,CAAC,SAAS,KAAK;QACZ,mCAAmC;IACvC,CAAC,CAAA","sourcesContent":["\n/* eslint-disable no-console */\n\nimport { debugging } from './config.js'\n\n\nexport function out(...texts: unknown[]): void {\n console.log(...texts)\n}\n\nexport function warn(...texts: unknown[]): void {\n console.log(...texts)\n //console.error(...texts)\n}\n\nexport function error(...texts: unknown[]): void {\n console.log(...texts)\n //console.error(...texts)\n}\n\nexport function log(...texts: unknown[]): void {\n console.log(...texts)\n}\n\nexport const debug: (...texts: unknown[]) => void = (debugging)\n ? function debug(...texts: unknown[]) {\n console.log(...texts)\n }\n : function debug() {\n // no-op when debugging is disabled\n }\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"chalk.js","sourceRoot":"","sources":["../../src/packages/chalk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,gFAAgF;AAChF,gFAAgF;AAChF,iFAAiF;AACjF,iFAAiF;AACjF,mCAAmC;AACnC,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,6DAA6D;AAC7D,eAAe;IACX,GAAG,EAAE,KAAK,CAAC,GAAG;IACd,IAAI,EAAE,KAAK,CAAC,IAAI;IAChB,MAAM,EAAE,KAAK,CAAC,MAAM;IACpB,IAAI,EAAE,KAAK,CAAC,IAAI;IAChB,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAO,0CAA0C;IAC7E,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAG,0CAA0C;IAC7E,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAI,sCAAsC;IACzE,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,mCAAmC;IACtE,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAI,mCAAmC;CACzE,CAAA","sourcesContent":["import chalk from 'chalk'\n\n// Local replacement for `chalk-extensions`. That package monkey-patches chalk's\n// shared singleton with dozens of named colours; we only use a handful, so this\n// is a small facade that delegates to chalk and adds just those. Each entry is a\n// chalk instance, so both call form (`chalk.orange(x)`) and tagged-template form\n// (`chalk.mediumgreen\\`…\\``) work.\n//\n// The custom colours reproduce chalk-extensions' exact definitions. It defined\n// several via chalk's CSS-keyword helper; the equivalent hex is inlined here so\n// output is identical without loading chalk's keyword table.\nexport default {\n red: chalk.red,\n grey: chalk.grey,\n yellow: chalk.yellow,\n blue: chalk.blue,\n orange: chalk.hex('#FF8C00'), // chalk-extensions: keyword('darkorange')\n brightblue: chalk.hex('#1E90FF'), // chalk-extensions: keyword('dodgerblue')\n lightgrey: chalk.hex('#C0C0C0'), // chalk-extensions: keyword('silver')\n mediumgreen: chalk.hex('#20d970'), // chalk-extensions: hex('#20d970')\n mediumred: chalk.hex('#e0444c') // chalk-extensions: hex('#e0444c')\n}\n"]}
1
+ {"version":3,"file":"chalk.js","sourceRoot":"","sources":["../../src/packages/chalk.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,gFAAgF;AAChF,gFAAgF;AAChF,iFAAiF;AACjF,iFAAiF;AACjF,mCAAmC;AACnC,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,6DAA6D;AAC7D,eAAe;IACX,GAAG,EAAE,KAAK,CAAC,GAAG;IACd,IAAI,EAAE,KAAK,CAAC,IAAI;IAChB,MAAM,EAAE,KAAK,CAAC,MAAM;IACpB,IAAI,EAAE,KAAK,CAAC,IAAI;IAChB,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAO,0CAA0C;IAC7E,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAG,0CAA0C;IAC7E,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAI,sCAAsC;IACzE,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,mCAAmC;IACtE,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAI,mCAAmC;CACzE,CAAA","sourcesContent":["\nimport chalk from 'chalk'\n\n\n// Local replacement for `chalk-extensions`. That package monkey-patches chalk's\n// shared singleton with dozens of named colours; we only use a handful, so this\n// is a small facade that delegates to chalk and adds just those. Each entry is a\n// chalk instance, so both call form (`chalk.orange(x)`) and tagged-template form\n// (`chalk.mediumgreen\\`…\\``) work.\n//\n// The custom colours reproduce chalk-extensions' exact definitions. It defined\n// several via chalk's CSS-keyword helper; the equivalent hex is inlined here so\n// output is identical without loading chalk's keyword table.\nexport default {\n red: chalk.red,\n grey: chalk.grey,\n yellow: chalk.yellow,\n blue: chalk.blue,\n orange: chalk.hex('#FF8C00'), // chalk-extensions: keyword('darkorange')\n brightblue: chalk.hex('#1E90FF'), // chalk-extensions: keyword('dodgerblue')\n lightgrey: chalk.hex('#C0C0C0'), // chalk-extensions: keyword('silver')\n mediumgreen: chalk.hex('#20d970'), // chalk-extensions: hex('#20d970')\n mediumred: chalk.hex('#e0444c') // chalk-extensions: hex('#e0444c')\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"esmReload.js","sourceRoot":"","sources":["../../src/packages/esmReload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAoCjD,MAAM,mBAAmB,GAAG,2CAA2C,CAAA;AAEvE,IAAI,QAAQ,GAAG,CAAC,CAAA;AAEhB,SAAS,gBAAgB;IACrB,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAC9D,CAAC;AAED,SAAS,YAAY,CAAC,GAAW;IAC7B,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAC9B,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACxC,SAAS,CAAC,MAAM,GAAG,EAAE,CAAA;IACrB,OAAO,CAAC,MAAM,GAAG,EAAE,CAAA;IACnB,OAAO,SAAS,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI,CAAA;AAC1C,CAAC;AAED,SAAS,cAAc,CAAC,GAAQ;IAC5B,OAAO,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AACjD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CACzB,SAAiB,EACjB,OAAuB,EACvB,WAAwB;IAExB,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;IAEpD,IAAI,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QACvF,OAAO,MAAM,CAAA;IACjB,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAE/B,yEAAyE;IACzE,0EAA0E;IAC1E,IAAI,cAAc,CAAC,GAAG,CAAC;QAAE,OAAO,MAAM,CAAA;IAEtC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IAC5C,MAAM,QAAQ,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE;QAClD,CAAC,CAAC,0BAA0B,QAAQ,EAAE,EAAE;QACxC,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;IAEjD,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,MAAM,CAAA;IAEpC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;IACjC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAA;IAE/C,OAAO;QACH,GAAG,MAAM;QACT,GAAG,EAAE,GAAG,CAAC,IAAI;KAChB,CAAA;AACL,CAAC;AAED,IAAI,CAAC,gBAAgB,EAAE,EAAE,CAAC;IACtB,QAAQ,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAA;AACzC,CAAC","sourcesContent":["import { isBuiltin, register } from 'node:module'\n\n/*\n * Based on esm-reload by Marcel Laverdet and Pierre-Yves Gérardy.\n *\n * ISC License\n *\n * Copyright 2024 Marcel Laverdet & Pierre-Yves Gérardy\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\ninterface ResolveContext {\n parentURL?: string\n}\n\ninterface ResolveResult {\n url: string\n [key: string]: unknown\n}\n\ntype NextResolve = (\n specifier: string,\n context: ResolveContext\n) => ResolveResult | Promise<ResolveResult>\n\nconst cachedModulePattern = /\\._cached_\\.(?:[cm]?js|[cm]?ts|jsx|tsx)$/i\n\nlet reloadId = 0\n\nfunction isLoaderInstance(): boolean {\n return new URL(import.meta.url).searchParams.has('loader')\n}\n\nfunction isThisModule(url: string): boolean {\n const candidate = new URL(url)\n const current = new URL(import.meta.url)\n candidate.search = ''\n current.search = ''\n return candidate.href === current.href\n}\n\nfunction isCachedModule(url: URL): boolean {\n return cachedModulePattern.test(url.pathname)\n}\n\nexport async function resolve(\n specifier: string,\n context: ResolveContext,\n nextResolve: NextResolve\n): Promise<ResolveResult> {\n const result = await nextResolve(specifier, context)\n\n if (isThisModule(result.url) || isBuiltin(result.url) || context.parentURL === undefined) {\n return result\n }\n\n const url = new URL(result.url)\n\n // A *._cached_.js/ts module and its dependency graph use Node's ordinary\n // process-wide module cache instead of inheriting the test file instance.\n if (isCachedModule(url)) return result\n\n const parentUrl = new URL(context.parentURL)\n const instance = url.searchParams.get('reload') === ''\n ? `sxy-test-runner-reload-${reloadId++}`\n : parentUrl.searchParams.get('sxyt-instance')\n\n if (instance === null) return result\n\n url.searchParams.delete('reload')\n url.searchParams.set('sxyt-instance', instance)\n\n return {\n ...result,\n url: url.href\n }\n}\n\nif (!isLoaderInstance()) {\n register(`${import.meta.url}?loader`)\n}\n"]}
1
+ {"version":3,"file":"esmReload.js","sourceRoot":"","sources":["../../src/packages/esmReload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAqCjD,MAAM,mBAAmB,GAAG,2CAA2C,CAAA;AAEvE,IAAI,QAAQ,GAAG,CAAC,CAAA;AAEhB,SAAS,gBAAgB;IACrB,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAC9D,CAAC;AAED,SAAS,YAAY,CAAC,GAAW;IAC7B,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IAC9B,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACxC,SAAS,CAAC,MAAM,GAAG,EAAE,CAAA;IACrB,OAAO,CAAC,MAAM,GAAG,EAAE,CAAA;IACnB,OAAO,SAAS,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI,CAAA;AAC1C,CAAC;AAED,SAAS,cAAc,CAAC,GAAQ;IAC5B,OAAO,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AACjD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CACzB,SAAiB,EACjB,OAAuB,EACvB,WAAwB;IAExB,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;IAEpD,IAAI,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QACvF,OAAO,MAAM,CAAA;IACjB,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAE/B,yEAAyE;IACzE,0EAA0E;IAC1E,IAAI,cAAc,CAAC,GAAG,CAAC;QAAE,OAAO,MAAM,CAAA;IAEtC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IAC5C,MAAM,QAAQ,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE;QAClD,CAAC,CAAC,0BAA0B,QAAQ,EAAE,EAAE;QACxC,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;IAEjD,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,MAAM,CAAA;IAEpC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;IACjC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAA;IAE/C,OAAO;QACH,GAAG,MAAM;QACT,GAAG,EAAE,GAAG,CAAC,IAAI;KAChB,CAAA;AACL,CAAC;AAED,IAAI,CAAC,gBAAgB,EAAE,EAAE,CAAC;IACtB,QAAQ,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAA;AACzC,CAAC","sourcesContent":["\nimport { isBuiltin, register } from 'node:module'\n\n\n/*\n * Based on esm-reload by Marcel Laverdet and Pierre-Yves Gérardy.\n *\n * ISC License\n *\n * Copyright 2024 Marcel Laverdet & Pierre-Yves Gérardy\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\ninterface ResolveContext {\n parentURL?: string\n}\n\ninterface ResolveResult {\n url: string\n [key: string]: unknown\n}\n\ntype NextResolve = (\n specifier: string,\n context: ResolveContext\n) => ResolveResult | Promise<ResolveResult>\n\nconst cachedModulePattern = /\\._cached_\\.(?:[cm]?js|[cm]?ts|jsx|tsx)$/i\n\nlet reloadId = 0\n\nfunction isLoaderInstance(): boolean {\n return new URL(import.meta.url).searchParams.has('loader')\n}\n\nfunction isThisModule(url: string): boolean {\n const candidate = new URL(url)\n const current = new URL(import.meta.url)\n candidate.search = ''\n current.search = ''\n return candidate.href === current.href\n}\n\nfunction isCachedModule(url: URL): boolean {\n return cachedModulePattern.test(url.pathname)\n}\n\nexport async function resolve(\n specifier: string,\n context: ResolveContext,\n nextResolve: NextResolve\n): Promise<ResolveResult> {\n const result = await nextResolve(specifier, context)\n\n if (isThisModule(result.url) || isBuiltin(result.url) || context.parentURL === undefined) {\n return result\n }\n\n const url = new URL(result.url)\n\n // A *._cached_.js/ts module and its dependency graph use Node's ordinary\n // process-wide module cache instead of inheriting the test file instance.\n if (isCachedModule(url)) return result\n\n const parentUrl = new URL(context.parentURL)\n const instance = url.searchParams.get('reload') === ''\n ? `sxy-test-runner-reload-${reloadId++}`\n : parentUrl.searchParams.get('sxyt-instance')\n\n if (instance === null) return result\n\n url.searchParams.delete('reload')\n url.searchParams.set('sxyt-instance', instance)\n\n return {\n ...result,\n url: url.href\n }\n}\n\nif (!isLoaderInstance()) {\n register(`${import.meta.url}?loader`)\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"figures.js","sourceRoot":"","sources":["../../src/packages/figures.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,4EAA4E;AAC5E,kFAAkF;AAClF,SAAS,kBAAkB;IACvB,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QAC/B,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,OAAO,CAAA,CAAC,yBAAyB;IACjE,CAAC;IAED,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;WACvB,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,mBAAmB;WACnD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,qBAAqB;WAC3D,OAAO,CAAC,GAAG,CAAC,UAAU,KAAK,cAAc,CAAC,mBAAmB;WAC7D,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,kBAAkB;WAC/C,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,QAAQ;WACrC,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,gBAAgB;WACrC,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,WAAW;WAChC,OAAO,CAAC,GAAG,CAAC,iBAAiB,KAAK,oBAAoB,CAAA;AACjE,CAAC;AAED,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAA;AAEpC,MAAM,OAAO,GAAG;IACZ,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;IACzB,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;CAC7B,CAAA;AAED,eAAe,OAAO,CAAA","sourcesContent":["// Local replacement for the `figures` package (sindresorhus/figures).\n// The runner uses only `tick` and `cross`; we reproduce the main glyphs and\n// their Windows-console ASCII fallbacks, gated by the same unicode-support check.\nfunction isUnicodeSupported(): boolean {\n if (process.platform !== 'win32') {\n return process.env.TERM !== 'linux' // Linux console (kernel)\n }\n\n return Boolean(process.env.CI)\n || Boolean(process.env.WT_SESSION) // Windows Terminal\n || Boolean(process.env.TERMINUS_SUBLIME) // Terminus (<0.2.27)\n || process.env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder\n || process.env.TERM_PROGRAM === 'Terminus-Sublime'\n || process.env.TERM_PROGRAM === 'vscode'\n || process.env.TERM === 'xterm-256color'\n || process.env.TERM === 'alacritty'\n || process.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm'\n}\n\nconst useMain = isUnicodeSupported()\n\nconst figures = {\n tick: useMain ? '✔' : '√',\n cross: useMain ? '✖' : '×'\n}\n\nexport default figures\n"]}
1
+ {"version":3,"file":"figures.js","sourceRoot":"","sources":["../../src/packages/figures.ts"],"names":[],"mappings":"AACA,sEAAsE;AACtE,4EAA4E;AAC5E,kFAAkF;AAClF,SAAS,kBAAkB;IACvB,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QAC/B,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,OAAO,CAAA,CAAC,yBAAyB;IACjE,CAAC;IAED,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;WACvB,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,mBAAmB;WACnD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,qBAAqB;WAC3D,OAAO,CAAC,GAAG,CAAC,UAAU,KAAK,cAAc,CAAC,mBAAmB;WAC7D,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,kBAAkB;WAC/C,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,QAAQ;WACrC,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,gBAAgB;WACrC,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,WAAW;WAChC,OAAO,CAAC,GAAG,CAAC,iBAAiB,KAAK,oBAAoB,CAAA;AACjE,CAAC;AAED,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAA;AAEpC,MAAM,OAAO,GAAG;IACZ,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;IACzB,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;CAC7B,CAAA;AAED,eAAe,OAAO,CAAA","sourcesContent":["\n// Local replacement for the `figures` package (sindresorhus/figures).\n// The runner uses only `tick` and `cross`; we reproduce the main glyphs and\n// their Windows-console ASCII fallbacks, gated by the same unicode-support check.\nfunction isUnicodeSupported(): boolean {\n if (process.platform !== 'win32') {\n return process.env.TERM !== 'linux' // Linux console (kernel)\n }\n\n return Boolean(process.env.CI)\n || Boolean(process.env.WT_SESSION) // Windows Terminal\n || Boolean(process.env.TERMINUS_SUBLIME) // Terminus (<0.2.27)\n || process.env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder\n || process.env.TERM_PROGRAM === 'Terminus-Sublime'\n || process.env.TERM_PROGRAM === 'vscode'\n || process.env.TERM === 'xterm-256color'\n || process.env.TERM === 'alacritty'\n || process.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm'\n}\n\nconst useMain = isUnicodeSupported()\n\nconst figures = {\n tick: useMain ? '✔' : '√',\n cross: useMain ? '✖' : '×'\n}\n\nexport default figures\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"loadConfig.js","sourceRoot":"","sources":["../../src/packages/loadConfig.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,yFAAyF;AACzF,uFAAuF;AACvF,yFAAyF;AACzF,oBAAoB;AAEpB,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAA;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;AAE7C,MAAM,CAAC,KAAK,UAAU,UAAU,CAC5B,WAAqB,EACrB,YAAsB,CAAC,EAAE,EAAE,QAAQ,CAAC;IAEpC,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;IAEhC,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QAC/B,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACnC,KAAK,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAC;gBACjC,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE,GAAG,UAAU,IAAI,GAAG,EAAE,CAAC,CAAA;gBACvE,IAAI,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;oBAC3B,OAAO,CAAC,MAAM,MAAM,CAAC,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC,OAAY,CAAA;gBAChE,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,IAAI,CAAA;AACf,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAc,cAAsB;IACrE,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,CAAA;IACxD,IAAI,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC3B,OAAO,CAAC,MAAM,MAAM,CAAC,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC,OAAY,CAAA;IAChE,CAAC;IACD,OAAO,IAAI,CAAA;AACf,CAAC","sourcesContent":["// Local replacement for sxy-dev-tools' loadConfig / loadConfigExact.\n// Searches the given locations for `<configName>.{js,cjs,mjs}` (js first, per location),\n// dynamically imports the first match and returns its default export, or null if none.\n// The upstream `types` / mergeConfig path was dead here (the runner never passes types),\n// so it is omitted.\n\nimport { existsSync } from 'fs'\nimport { join } from 'path'\n\nconst configExtensions = ['js', 'cjs', 'mjs']\n\nexport async function loadConfig<T = unknown>(\n configNames: string[],\n locations: string[] = ['', 'config']\n): Promise<T | null> {\n const projectDir = process.cwd()\n\n for (const location of locations) {\n for (const configName of configNames) {\n for (const ext of configExtensions) {\n const fullLocation = join(projectDir, location, `${configName}.${ext}`)\n if (existsSync(fullLocation)) {\n return (await import('file://' + fullLocation)).default as T\n }\n }\n }\n }\n\n return null\n}\n\nexport async function loadConfigExact<T = unknown>(configLocation: string): Promise<T | null> {\n const fullLocation = join(process.cwd(), configLocation)\n if (existsSync(fullLocation)) {\n return (await import('file://' + fullLocation)).default as T\n }\n return null\n}\n"]}
1
+ {"version":3,"file":"loadConfig.js","sourceRoot":"","sources":["../../src/packages/loadConfig.ts"],"names":[],"mappings":"AACA,qEAAqE;AACrE,yFAAyF;AACzF,uFAAuF;AACvF,yFAAyF;AACzF,oBAAoB;AAEpB,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAA;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;AAE7C,MAAM,CAAC,KAAK,UAAU,UAAU,CAC5B,WAAqB,EACrB,YAAsB,CAAC,EAAE,EAAE,QAAQ,CAAC;IAEpC,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;IAEhC,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QAC/B,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACnC,KAAK,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAC;gBACjC,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE,GAAG,UAAU,IAAI,GAAG,EAAE,CAAC,CAAA;gBACvE,IAAI,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;oBAC3B,OAAO,CAAC,MAAM,MAAM,CAAC,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC,OAAY,CAAA;gBAChE,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,IAAI,CAAA;AACf,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAc,cAAsB;IACrE,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,CAAA;IACxD,IAAI,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC3B,OAAO,CAAC,MAAM,MAAM,CAAC,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC,OAAY,CAAA;IAChE,CAAC;IACD,OAAO,IAAI,CAAA;AACf,CAAC","sourcesContent":["\n// Local replacement for sxy-dev-tools' loadConfig / loadConfigExact.\n// Searches the given locations for `<configName>.{js,cjs,mjs}` (js first, per location),\n// dynamically imports the first match and returns its default export, or null if none.\n// The upstream `types` / mergeConfig path was dead here (the runner never passes types),\n// so it is omitted.\n\nimport { existsSync } from 'fs'\nimport { join } from 'path'\n\n\nconst configExtensions = ['js', 'cjs', 'mjs']\n\nexport async function loadConfig<T = unknown>(\n configNames: string[],\n locations: string[] = ['', 'config']\n): Promise<T | null> {\n const projectDir = process.cwd()\n\n for (const location of locations) {\n for (const configName of configNames) {\n for (const ext of configExtensions) {\n const fullLocation = join(projectDir, location, `${configName}.${ext}`)\n if (existsSync(fullLocation)) {\n return (await import('file://' + fullLocation)).default as T\n }\n }\n }\n }\n\n return null\n}\n\nexport async function loadConfigExact<T = unknown>(configLocation: string): Promise<T | null> {\n const fullLocation = join(process.cwd(), configLocation)\n if (existsSync(fullLocation)) {\n return (await import('file://' + fullLocation)).default as T\n }\n return null\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"mergeStructuredConfig.js","sourceRoot":"","sources":["../../src/packages/mergeStructuredConfig.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,2FAA2F;AAC3F,oFAAoF;AACpF,4FAA4F;AAC5F,uFAAuF;AACvF,2FAA2F;AAC3F,0FAA0F;AAE1F,MAAM,UAAU,qBAAqB,CACjC,SAAiB,EACjB,UAAa,EACb,GAAG,YAAiB;IAEpB,MAAM,WAAW,GAAG,eAAe,CAAC,UAAU,CAA4B,CAAA;IAC1E,MAAM,MAAM,GAAG,SAAoC,CAAA;IAEnD,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;QACrC,IAAI,WAAW,KAAK,SAAS,IAAI,WAAW,KAAK,IAAI;YAAE,SAAQ;QAC/D,KAAK,MAAM,GAAG,IAAI,WAAsC,EAAE,CAAC;YACvD,MAAM,UAAU,GAAI,WAAuC,CAAC,GAAG,CAAC,CAAA;YAChE,IAAI,GAAG,IAAI,MAAM,EAAE,CAAC;gBAChB,WAAW,CAAC,GAAG,CAAC,GAAG,qBAAqB,CACnC,MAAM,CAAC,GAAG,CAAwB,IAAI,EAAE,EACzC,WAAW,CAAC,GAAG,CAAC,EAChB,UAAU,CACb,CAAA;YACL,CAAC;iBAAM,CAAC;gBACJ,WAAW,CAAC,GAAG,CAAC,GAAG,UAAU,CAAA;YACjC,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,WAAgB,CAAA;AAC3B,CAAC","sourcesContent":["// Local replacement for sxy-dev-tools' mergeStructuredConfig.\n// `structure` marks which keys are nested config branches (terminated by an empty object);\n// those are merged recursively, everything else is overwritten by the later config.\n// The upstream used a global `Object.copy` (from sxy-standard-object-copy) to deep-copy the\n// base; the built-in `structuredClone` does the same. Only the base config (pure data:\n// defaultConfig and its execution/watch branches) is ever cloned - user-supplied functions\n// (setup/teardown) sit on non-structure keys and are assigned by reference, never cloned.\n\nexport function mergeStructuredConfig<T, E = unknown>(\n structure: object,\n baseConfig: T,\n ...extraConfigs: E[]\n): T {\n const finalConfig = structuredClone(baseConfig) as Record<string, unknown>\n const struct = structure as Record<string, unknown>\n\n for (const extraConfig of extraConfigs) {\n if (extraConfig === undefined || extraConfig === null) continue\n for (const key in extraConfig as Record<string, unknown>) {\n const extraValue = (extraConfig as Record<string, unknown>)[key]\n if (key in struct) {\n finalConfig[key] = mergeStructuredConfig(\n (struct[key] as object | undefined) ?? {},\n finalConfig[key],\n extraValue\n )\n } else {\n finalConfig[key] = extraValue\n }\n }\n }\n\n return finalConfig as T\n}\n"]}
1
+ {"version":3,"file":"mergeStructuredConfig.js","sourceRoot":"","sources":["../../src/packages/mergeStructuredConfig.ts"],"names":[],"mappings":"AACA,8DAA8D;AAC9D,2FAA2F;AAC3F,oFAAoF;AACpF,4FAA4F;AAC5F,uFAAuF;AACvF,2FAA2F;AAC3F,0FAA0F;AAE1F,MAAM,UAAU,qBAAqB,CACjC,SAAiB,EACjB,UAAa,EACb,GAAG,YAAiB;IAEpB,MAAM,WAAW,GAAG,eAAe,CAAC,UAAU,CAA4B,CAAA;IAC1E,MAAM,MAAM,GAAG,SAAoC,CAAA;IAEnD,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;QACrC,IAAI,WAAW,KAAK,SAAS,IAAI,WAAW,KAAK,IAAI;YAAE,SAAQ;QAC/D,KAAK,MAAM,GAAG,IAAI,WAAsC,EAAE,CAAC;YACvD,MAAM,UAAU,GAAI,WAAuC,CAAC,GAAG,CAAC,CAAA;YAChE,IAAI,GAAG,IAAI,MAAM,EAAE,CAAC;gBAChB,WAAW,CAAC,GAAG,CAAC,GAAG,qBAAqB,CACnC,MAAM,CAAC,GAAG,CAAwB,IAAI,EAAE,EACzC,WAAW,CAAC,GAAG,CAAC,EAChB,UAAU,CACb,CAAA;YACL,CAAC;iBAAM,CAAC;gBACJ,WAAW,CAAC,GAAG,CAAC,GAAG,UAAU,CAAA;YACjC,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,WAAgB,CAAA;AAC3B,CAAC","sourcesContent":["\n// Local replacement for sxy-dev-tools' mergeStructuredConfig.\n// `structure` marks which keys are nested config branches (terminated by an empty object);\n// those are merged recursively, everything else is overwritten by the later config.\n// The upstream used a global `Object.copy` (from sxy-standard-object-copy) to deep-copy the\n// base; the built-in `structuredClone` does the same. Only the base config (pure data:\n// defaultConfig and its execution/watch branches) is ever cloned - user-supplied functions\n// (setup/teardown) sit on non-structure keys and are assigned by reference, never cloned.\n\nexport function mergeStructuredConfig<T, E = unknown>(\n structure: object,\n baseConfig: T,\n ...extraConfigs: E[]\n): T {\n const finalConfig = structuredClone(baseConfig) as Record<string, unknown>\n const struct = structure as Record<string, unknown>\n\n for (const extraConfig of extraConfigs) {\n if (extraConfig === undefined || extraConfig === null) continue\n for (const key in extraConfig as Record<string, unknown>) {\n const extraValue = (extraConfig as Record<string, unknown>)[key]\n if (key in struct) {\n finalConfig[key] = mergeStructuredConfig(\n (struct[key] as object | undefined) ?? {},\n finalConfig[key],\n extraValue\n )\n } else {\n finalConfig[key] = extraValue\n }\n }\n }\n\n return finalConfig as T\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"slash.js","sourceRoot":"","sources":["../../src/packages/slash.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,yEAAyE;AACzE,+EAA+E;AAC/E,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAY;IACtC,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,OAAO,IAAI,CAAA;IAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;AACnC,CAAC","sourcesContent":["// Local replacement for the `slash` package (sindresorhus/slash).\n// Converts Windows backslash path separators to forward slashes, leaving\n// extended-length paths (\\\\?\\...) untouched — matching the upstream behaviour.\nexport default function slash(path: string): string {\n if (path.startsWith('\\\\\\\\?\\\\')) return path\n return path.replace(/\\\\/g, '/')\n}\n"]}
1
+ {"version":3,"file":"slash.js","sourceRoot":"","sources":["../../src/packages/slash.ts"],"names":[],"mappings":"AACA,kEAAkE;AAClE,yEAAyE;AACzE,+EAA+E;AAC/E,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAY;IACtC,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,OAAO,IAAI,CAAA;IAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;AACnC,CAAC","sourcesContent":["\n// Local replacement for the `slash` package (sindresorhus/slash).\n// Converts Windows backslash path separators to forward slashes, leaving\n// extended-length paths (\\\\?\\...) untouched — matching the upstream behaviour.\nexport default function slash(path: string): string {\n if (path.startsWith('\\\\\\\\?\\\\')) return path\n return path.replace(/\\\\/g, '/')\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"timeProfiler.js","sourceRoot":"","sources":["../../src/packages/timeProfiler.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,uFAAuF;AACvF,sFAAsF;AACtF,kDAAkD;AAElD,OAAO,KAAK,MAAM,YAAY,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAOlC,MAAM,UAAU,kBAAkB,CAAC,SAAS,GAAG,IAAI;IAC/C,IAAI,CAAC,SAAS,EAAE,CAAC;QACb,OAAO;YACH,WAAW,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE;YACpC,gBAAgB,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE;SAClD,CAAA;IACL,CAAC;IAED,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,EAAU,EAAQ,EAAE;QAC9C,GAAG,CAAC,KAAK,CAAC,MAAM,CAAA,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,KAAK,CAAC,MAAM,CAAA,GAAG,EAAE,CAAC,cAAc,EAAE,IAAI,CAAC,CAAA;IAC/E,CAAC,CAAA;IAED,OAAO;QACH,WAAW,CAAC,IAAI,EAAE,IAAI;YAClB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;YACxB,MAAM,MAAM,GAAG,IAAI,EAAE,CAAA;YACrB,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAA;YAChC,OAAO,MAAM,CAAA;QACjB,CAAC;QACD,KAAK,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI;YAC7B,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;YACxB,MAAM,MAAM,GAAG,MAAM,IAAI,EAAE,CAAA;YAC3B,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAA;YAChC,OAAO,MAAM,CAAA;QACjB,CAAC;KACJ,CAAA;AACL,CAAC","sourcesContent":["// Local replacement for sxy-dev-tools' createTimeProfiler.\n// The upstream package's index eagerly imports sxy-standard + sxy-standard-object-copy\n// (global-patching side effects, ~108ms to load); this trivial reimplementation drops\n// that cost and the external dependency entirely.\n\nimport chalk from './chalk.js'\nimport { out } from '../output.js'\n\nexport interface TimeProfiler {\n timeProfile: <T>(name: string, task: () => T) => T\n timeProfileAsync: <T>(name: string, task: () => T | Promise<T>) => Promise<T>\n}\n\nexport function createTimeProfiler(profiling = true): TimeProfiler {\n if (!profiling) {\n return {\n timeProfile: (_name, task) => task(),\n timeProfileAsync: async (_name, task) => task()\n }\n }\n\n const report = (name: string, ms: number): void => {\n out(chalk.yellow`${name}` + ' - ' + chalk.orange`${ms.toLocaleString()}ms`)\n }\n\n return {\n timeProfile(name, task) {\n const start = Date.now()\n const result = task()\n report(name, Date.now() - start)\n return result\n },\n async timeProfileAsync(name, task) {\n const start = Date.now()\n const result = await task()\n report(name, Date.now() - start)\n return result\n }\n }\n}\n"]}
1
+ {"version":3,"file":"timeProfiler.js","sourceRoot":"","sources":["../../src/packages/timeProfiler.ts"],"names":[],"mappings":"AACA,2DAA2D;AAC3D,uFAAuF;AACvF,sFAAsF;AACtF,kDAAkD;AAElD,OAAO,KAAK,MAAM,YAAY,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAQlC,MAAM,UAAU,kBAAkB,CAAC,SAAS,GAAG,IAAI;IAC/C,IAAI,CAAC,SAAS,EAAE,CAAC;QACb,OAAO;YACH,WAAW,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE;YACpC,gBAAgB,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE;SAClD,CAAA;IACL,CAAC;IAED,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,EAAU,EAAQ,EAAE;QAC9C,GAAG,CAAC,KAAK,CAAC,MAAM,CAAA,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,KAAK,CAAC,MAAM,CAAA,GAAG,EAAE,CAAC,cAAc,EAAE,IAAI,CAAC,CAAA;IAC/E,CAAC,CAAA;IAED,OAAO;QACH,WAAW,CAAC,IAAI,EAAE,IAAI;YAClB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;YACxB,MAAM,MAAM,GAAG,IAAI,EAAE,CAAA;YACrB,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAA;YAChC,OAAO,MAAM,CAAA;QACjB,CAAC;QACD,KAAK,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI;YAC7B,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;YACxB,MAAM,MAAM,GAAG,MAAM,IAAI,EAAE,CAAA;YAC3B,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAA;YAChC,OAAO,MAAM,CAAA;QACjB,CAAC;KACJ,CAAA;AACL,CAAC","sourcesContent":["\n// Local replacement for sxy-dev-tools' createTimeProfiler.\n// The upstream package's index eagerly imports sxy-standard + sxy-standard-object-copy\n// (global-patching side effects, ~108ms to load); this trivial reimplementation drops\n// that cost and the external dependency entirely.\n\nimport chalk from './chalk.js'\nimport { out } from '../output.js'\n\n\nexport interface TimeProfiler {\n timeProfile: <T>(name: string, task: () => T) => T\n timeProfileAsync: <T>(name: string, task: () => T | Promise<T>) => Promise<T>\n}\n\nexport function createTimeProfiler(profiling = true): TimeProfiler {\n if (!profiling) {\n return {\n timeProfile: (_name, task) => task(),\n timeProfileAsync: async (_name, task) => task()\n }\n }\n\n const report = (name: string, ms: number): void => {\n out(chalk.yellow`${name}` + ' - ' + chalk.orange`${ms.toLocaleString()}ms`)\n }\n\n return {\n timeProfile(name, task) {\n const start = Date.now()\n const result = task()\n report(name, Date.now() - start)\n return result\n },\n async timeProfileAsync(name, task) {\n const start = Date.now()\n const result = await task()\n report(name, Date.now() - start)\n return result\n }\n }\n}\n"]}
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { DescribeMeta } from './describe.js';
2
- import { FileMeta } from './meta.js';
1
+ import type { FileMeta } from './meta.js';
2
+ import type { DescribeMeta } from './describe.js';
3
3
  export type ExecutionMode = 'parallel' | 'sequential';
4
4
  export type GlobPattern = string | string[];
5
5
  export interface ExecutionConfig {
@@ -56,17 +56,6 @@ export interface DescribeParcel extends TaskExports {
56
56
  afterEachTest: (func: () => void | Promise<void>) => void;
57
57
  }
58
58
  export type DescribeCallback = (parcel: DescribeParcel) => void | Promise<void>;
59
- export interface Describe {
60
- counter: number;
61
- thing: string;
62
- meta?: DescribeMeta;
63
- tests: DescribeCallback;
64
- }
65
- export interface It {
66
- counter: number;
67
- should: string;
68
- test: (parcel: TestParcel) => void | Promise<void>;
69
- }
70
59
  export interface ParsedDescribe {
71
60
  its: It[];
72
61
  beforeDescribeExports: TaskExports;
@@ -75,76 +64,19 @@ export interface ParsedDescribe {
75
64
  afterEachTestFunc?: () => void | Promise<void>;
76
65
  error?: unknown;
77
66
  }
78
- export interface TestError extends Error {
79
- actual?: unknown;
80
- expected?: unknown;
81
- }
82
- export interface ItResult {
83
- counter: number;
84
- should: string;
85
- success: boolean | null;
86
- time: number;
87
- error?: TestError;
88
- logs: unknown[][];
89
- }
90
- export interface ItResultsSummary {
91
- total: number;
92
- passes: number;
93
- }
94
- export interface DescribeResult {
95
- counter: number;
96
- thing: string;
97
- success: boolean | null;
98
- time: number;
99
- itResults: ItResult[];
100
- itResultsSummary: ItResultsSummary;
101
- logs?: unknown[][];
102
- error?: unknown;
103
- }
104
- export interface DescribeResultsSummary {
105
- total: number;
106
- passes: number;
107
- invalid: number;
108
- itsTotal: number;
109
- itsPasses: number;
110
- }
111
- export interface TestFile {
112
- file: string;
113
- describes?: Describe[];
114
- meta?: FileMeta;
115
- error?: string | false;
116
- logs?: unknown[][];
117
- }
118
- export interface TestResult {
119
- file: string;
120
- success: boolean | null;
121
- describeResults: DescribeResult[];
122
- describeResultsSummary: DescribeResultsSummary;
123
- logs: unknown[][];
124
- }
125
- export interface TestsResultsSummary {
126
- total: number;
127
- passes: number;
128
- invalid: number;
129
- describesTotal: number;
130
- describesPasses: number;
131
- describesInvalid: number;
132
- itsTotal: number;
133
- itsPasses: number;
134
- }
135
67
  export type DependencyTrees = Record<string, string[]>;
136
68
  export type OutFn = (...texts: unknown[]) => void;
137
- export interface AllowedArgument {
138
- flag?: string;
139
- hasValue: boolean;
140
- }
141
- export type AllowedArguments = Record<string, AllowedArgument>;
142
- export type AllowedFlags = Record<string, string>;
143
- export type ParsedArguments = Record<string, string | true>;
144
- export interface TestExecutionFilters {
145
- describe?: string;
146
- it?: string;
147
- }
69
+ export type Describe = {
70
+ counter: number;
71
+ thing: string;
72
+ meta?: DescribeMeta;
73
+ tests: DescribeCallback;
74
+ };
75
+ export type It = {
76
+ counter: number;
77
+ should: string;
78
+ test: (parcel: TestParcel) => void | Promise<void>;
79
+ };
148
80
  export interface SxyTestRunnerGlobal {
149
81
  describes: Describe[];
150
82
  describeCounter: number;