sxy-test-runner 2.5.1 → 2.5.2

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 (48) hide show
  1. package/AGENTS.md +8 -0
  2. package/dist/cli/init.js +3 -0
  3. package/dist/cli/init.js.map +1 -1
  4. package/dist/cli/lib/addBasePath.js +1 -1
  5. package/dist/cli/lib/addBasePath.js.map +1 -1
  6. package/dist/cli/lib/buildDependencyTrees.d.ts +1 -1
  7. package/dist/cli/lib/buildDependencyTrees.js +2 -2
  8. package/dist/cli/lib/buildDependencyTrees.js.map +1 -1
  9. package/dist/cli/lib/defaultConfig.js +1 -0
  10. package/dist/cli/lib/defaultConfig.js.map +1 -1
  11. package/dist/cli/lib/failureEntries.js +5 -2
  12. package/dist/cli/lib/failureEntries.js.map +1 -1
  13. package/dist/cli/lib/parseDescribe.js +1 -1
  14. package/dist/cli/lib/parseDescribe.js.map +1 -1
  15. package/dist/cli/lib/runDescribe.js +1 -1
  16. package/dist/cli/lib/runDescribe.js.map +1 -1
  17. package/dist/cli/lib/runDescribeRun.js +1 -1
  18. package/dist/cli/lib/runDescribeRun.js.map +1 -1
  19. package/dist/cli/lib/runIt.js +1 -1
  20. package/dist/cli/lib/runIt.js.map +1 -1
  21. package/dist/cli/lib/runTests.js +9 -188
  22. package/dist/cli/lib/runTests.js.map +1 -1
  23. package/dist/cli/lib/showFailuresColorized.d.ts +2 -0
  24. package/dist/cli/lib/showFailuresColorized.js +52 -0
  25. package/dist/cli/lib/showFailuresColorized.js.map +1 -0
  26. package/dist/cli/lib/showTestFileResult.d.ts +7 -0
  27. package/dist/cli/lib/{showTestResult.js → showTestFileResult.js} +15 -9
  28. package/dist/cli/lib/showTestFileResult.js.map +1 -0
  29. package/dist/cli/lib/showTestResultsSummary.d.ts +8 -0
  30. package/dist/cli/lib/showTestResultsSummary.js +213 -0
  31. package/dist/cli/lib/showTestResultsSummary.js.map +1 -0
  32. package/dist/cli/lib/timeProfiler.d.ts +3 -0
  33. package/dist/cli/lib/{timeProfier.js → timeProfiler.js} +1 -1
  34. package/dist/cli/lib/timeProfiler.js.map +1 -0
  35. package/dist/cli/lib/validateConfig.js +3 -0
  36. package/dist/cli/lib/validateConfig.js.map +1 -1
  37. package/dist/cli/watch.d.ts +1 -1
  38. package/dist/cli/watch.js +4 -3
  39. package/dist/cli/watch.js.map +1 -1
  40. package/dist/packages/timeProfiler.d.ts +1 -1
  41. package/dist/packages/timeProfiler.js.map +1 -1
  42. package/dist/types.d.ts +1 -0
  43. package/dist/types.js.map +1 -1
  44. package/package.json +2 -1
  45. package/dist/cli/lib/showTestResult.d.ts +0 -4
  46. package/dist/cli/lib/showTestResult.js.map +0 -1
  47. package/dist/cli/lib/timeProfier.d.ts +0 -3
  48. package/dist/cli/lib/timeProfier.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"runTests.js","sourceRoot":"","sources":["../../../src/cli/lib/runTests.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAK7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,OAAO,MAAM,2BAA2B,CAAA;AAC/C,OAAO,KAAK,MAAM,yBAAyB,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,YAAY,EAAiB,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EAAE,OAAO,EAAmB,MAAM,cAAc,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OA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YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,aAAa,CAAC,CAAC,EAChF,UAAU,CACb,CAAA;gBAED,mEAAmE;gBACnE,KAAK,MAAM,OAAO,IAAI,QAAQ;oBAAE,YAAY,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;gBACvE,SAAS,CACL,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,mBAAmB,EAAE,UAAU,EACpE,KAAK,CAAC,eAAe,CAAC,IAAI,CAC7B,CAAA;YACL,CAAC;YAED,gBAAgB;YAChB,uDAAuD;YACvD,OAAO,SAAS,CAAA;QACpB,CAAC,CAAC,CAAA;IACN,CAAC;YAAS,CAAC;QACP,IAAI,YAAY,KAAK,SAAS;YAAE,YAAY,CAAC,KAAK,CAAC,UAAU,EAAE,CAAA;IACnE,CAAC;AACL,CAAC","sourcesContent":["\nimport { count } from 'sxy-lib/objects.js'\nimport { allObj as promiseAllObj } from 'sxy-lib/promises.js'\n\nimport type { FinalConfig, OutFn } from '../../types.js'\nimport type { TestExecutionFilters } from '../cliTypes.js'\nimport type { ReRunManager } from './reRunManager.js'\nimport { createTimeProfiler } from '../../packages/timeProfiler.js'\nimport figures from '../../packages/figures.js'\nimport chalk from '../../packages/chalk.js'\nimport { showTimeProfiling } from '../../config.js'\nimport { out as mainOut } from '../../output.js'\nimport { loadTestFile, type TestFile } from './loadTestFile.js'\nimport { runTest, type TestResult } from './runTest.js'\nimport { showTestLoadingError } from './showTestLoadingError.js'\nimport { showTestResult } from './showTestResult.js'\nimport { failureLines } from './failureLines.js'\nimport { failureEntries } from './failureEntries.js'\nimport { agentDone, agentFailure, agentRunStart } from './agentReport.js'\nimport { makeStopSignal, stopIfFailFast } from './stopSignal.js'\nimport { statusCodes, writeStatusFile } from './statusFile.js'\nimport { makeRunManagerState, type ReRunManageState } from './makeWatchRunState.js'\n\n\nconst { timeProfileAsync } = createTimeProfiler(showTimeProfiling)\n\nexport interface TestsResultsSummary {\n total: number\n passes: number\n invalid: number\n describesTotal: number\n describesPasses: number\n describesInvalid: number\n itsTotal: number\n itsPasses: number\n}\n\nexport type RunTestsPromise = Promise<boolean | null>\n\n// the summary lines, minus the colouring, for the status file\nfunction joinPlain(...parts: string[]): string {\n return parts.filter(part => part !== '').join(' ')\n}\n\nfunction plural(count: number, noun: string, verb: string): string {\n if (count < 1) return ''\n return `${count} ${noun}${count === 1 ? '' : 's'} ${verb}`\n}\n\nexport type Concurrency = {\n limit: number\n}\n\nfunction recordWithoutTests(state: ReRunManageState, testFile: string, testResult: TestResult): void {\n const describes = testResult.describeResults\n .filter(describeResult => describeResult.success === null)\n .map(describeResult => describeResult.thing)\n const fileWithoutTests = testResult.success === null\n if (fileWithoutTests || describes.length > 0) {\n state.withoutTests.set(testFile, {\n file: testResult.sourceFile ?? testResult.file, fileWithoutTests, describes\n })\n } else {\n state.withoutTests.delete(testFile)\n }\n}\n\nexport async function runTests(\n config: FinalConfig,\n testFiles: Set<string>,\n reRunManager: ReRunManager | undefined,\n concurrency: Concurrency = { limit: -1 }, // eslint-disable-line @typescript-eslint/no-unused-vars\n // -- WIP\n refresh: 'refresh' | 'cached' = 'refresh',\n customOut?: OutFn,\n filters: TestExecutionFilters = {}\n): RunTestsPromise {\n if (reRunManager !== undefined) {\n reRunManager.state.lastTestFiles = new Set(testFiles)\n reRunManager.state.activeRuns++ // whatever, obsolete. Can use it to check on things\n }\n\n const state = reRunManager?.state || makeRunManagerState()\n const runStartTime = new Date().getTime()\n const agentRun = agentRunStart(config, testFiles.size)\n const stop = makeStopSignal()\n //console.log('new runTests:', watchRunState?.activeRuns)\n //console.log(inspect(testFiles))\n\n try {\n const testRunPromises: Record<string, Promise<TestResult>> = {}\n const erroringTests: Record<string, TestFile> = {}\n const testRunOutPromises: Record<string, Promise<void>> = {}\n\n await timeProfileAsync('run tests', async () => {\n if (Array.isArray(testFiles) ? testFiles.length > 0 : testFiles.size > 0) {\n for (const testFile of testFiles) {\n //console.log('testFiles', testFiles)\n //console.log('testFile', testFile)\n\n // an earlier file failed under failFast - leave the rest unloaded\n if (stop.stopped) break\n\n const test = await loadTestFile(config, testFile, refresh)\n\n if (test.error !== undefined && test.error !== false) {\n erroringTests[testFile] = test\n state.failedTestFiles.add(testFile)\n showTestLoadingError(config, test, customOut)\n stopIfFailFast(config, stop, true)\n } else {\n const testRunPromise = runTest(config, test, filters, stop)\n testRunPromises[testFile] = testRunPromise\n\n testRunOutPromises[testFile] = testRunPromise.then(async testResult => {\n if (testResult.success === true || testResult.success === null) {\n state.failedTestFiles.delete(testResult.file)\n } else {\n state.failedTestFiles.add(testFile)\n }\n const executionFilterActive = filters.describe !== undefined || filters.it !== undefined\n // a filter makes files and describes look empty when they are not\n if (!executionFilterActive) recordWithoutTests(state, testFile, testResult)\n if (!executionFilterActive || testResult.describeResultsSummary.itsTotal > 0) {\n await showTestResult(config, testResult, customOut)\n }\n })\n\n // wait for the test to complete before proceeding if we are in 'sequential' mode\n if (config.execution.files === 'sequential') await testRunOutPromises[testFile]\n }\n }\n }\n })\n\n let runTestResults: Record<string, TestResult> = {}\n\n await timeProfileAsync('wait for tests to finish', async () => {\n runTestResults = await promiseAllObj(testRunPromises)\n\n // wait for the output to complete\n await promiseAllObj(testRunOutPromises)\n })\n\n return await timeProfileAsync('show initial test run results', () => {\n \n const out = customOut ?? mainOut\n\n const testsResultsSummary: TestsResultsSummary = {\n total: 0,\n passes: 0,\n invalid: 0,\n describesTotal: 0,\n describesPasses: 0,\n describesInvalid: 0,\n itsTotal: 0,\n itsPasses: 0\n // itsInvalid: 0 // we don't check whether tests run any asserts (we don't control the assertion lib)\n }\n let describesThrownCount = 0\n\n for (const testFile in runTestResults) {\n const runTestResult = runTestResults[testFile]\n if (!runTestResult) continue\n\n testsResultsSummary.total += +(runTestResult.success !== null)\n testsResultsSummary.passes += +(runTestResult.success ?? false)\n testsResultsSummary.invalid += +(runTestResult.success === null)\n testsResultsSummary.describesTotal += runTestResult.describeResultsSummary.total\n testsResultsSummary.describesPasses += runTestResult.describeResultsSummary.passes\n testsResultsSummary.describesInvalid += runTestResult.describeResultsSummary.invalid\n testsResultsSummary.itsTotal += runTestResult.describeResultsSummary.itsTotal\n testsResultsSummary.itsPasses += runTestResult.describeResultsSummary.itsPasses\n describesThrownCount += runTestResult.describeResults\n .filter(describeResult => describeResult.error !== undefined)\n .length\n }\n\n const failedToLoadCount = count(erroringTests)\n testsResultsSummary.total += failedToLoadCount\n\n if (\n (filters.describe !== undefined || filters.it !== undefined)\n && testsResultsSummary.itsTotal === 0\n && failedToLoadCount === 0\n && describesThrownCount === 0\n ) {\n out(chalk.orange('No tests matched the describe/test filters.'))\n const durationMs = new Date().getTime() - runStartTime\n writeStatusFile(\n config,\n statusCodes.couldNotRun,\n 'no tests matched the describe/test filters',\n [],\n durationMs\n )\n agentDone(\n config, agentRun, statusCodes.couldNotRun,\n 'no tests matched the describe/test filters', testsResultsSummary, durationMs,\n state.failedTestFiles.size\n )\n return null\n }\n\n out(config.compact ? '' : '\\n')\n\n const allPassed = (\n testsResultsSummary.passes === testsResultsSummary.total\n && testsResultsSummary.describesPasses === testsResultsSummary.describesTotal\n && testsResultsSummary.itsPasses === testsResultsSummary.itsTotal\n )\n\n if (allPassed) {\n out(chalk.mediumgreen(`${figures.tick}`))\n } else {\n out(chalk.mediumred(`${figures.cross}`))\n }\n\n // number of tests successful\n const testsText = `Tests: ${testsResultsSummary.itsPasses}/${testsResultsSummary.itsTotal}`\n if (testsResultsSummary.itsPasses === testsResultsSummary.itsTotal) {\n if (testsResultsSummary.itsTotal === 0) {\n out(chalk.grey(`${testsText}`))\n } else {\n out(chalk.mediumgreen(`${testsText}`))\n }\n } else {\n out(chalk.mediumred(`${testsText}`))\n }\n\n // number of items successful\n const describesText = `Items: ${testsResultsSummary.describesPasses}/${testsResultsSummary.describesTotal}`\n const invalidDescribesPlain = (testsResultsSummary.describesInvalid >= 1)\n ? (testsResultsSummary.describesInvalid === 1)\n ? '(+1 describe without tests)'\n : `(+${testsResultsSummary.describesInvalid} describes without tests)`\n : ''\n const describesThrownPlain = (describesThrownCount >= 1)\n ? (describesThrownCount === 1)\n ? '(1 describe errored)'\n : `(${describesThrownCount} describes errored)`\n : ''\n const describesDetailsText = [\n chalk.mediumred(describesThrownPlain), chalk.grey(invalidDescribesPlain)\n ]\n .filter(text => text !== '')\n .join(' ')\n const describesDetailsSuffix = describesDetailsText === '' ? '' : ` ${describesDetailsText}`\n if (testsResultsSummary.describesPasses === testsResultsSummary.describesTotal) {\n if (testsResultsSummary.describesTotal === 0) {\n out(chalk.grey(`${describesText}`) + describesDetailsSuffix)\n } else {\n out(chalk.mediumgreen(`${describesText}`) + describesDetailsSuffix)\n }\n } else {\n out(chalk.mediumred(`${describesText}`) + describesDetailsSuffix)\n }\n\n // number of test files successful\n const testFilesText = `Test Files: ${testsResultsSummary.passes}/${testsResultsSummary.total}`\n const invalidTestFilesPlain = (testsResultsSummary.invalid >= 1)\n ? (testsResultsSummary.invalid === 1)\n ? '(+1 file without tests)'\n : `(+${testsResultsSummary.invalid} files without tests)`\n : ''\n const failedToLoadPlain = (failedToLoadCount >= 1)\n ? (failedToLoadCount === 1)\n ? '(1 file failed to load, or errored)'\n : `(${failedToLoadCount} files failed to load, or errored)`\n : ''\n const testFilesDetailsText = [\n chalk.mediumred(failedToLoadPlain), chalk.grey(invalidTestFilesPlain)\n ]\n .filter(text => text !== '')\n .join(' ')\n const testFilesDetailsSuffix = testFilesDetailsText === '' ? '' : ` ${testFilesDetailsText}`\n if (testsResultsSummary.passes === testsResultsSummary.total) {\n if (testsResultsSummary.describesTotal === 0) {\n out(chalk.grey(`${testFilesText}`) + testFilesDetailsSuffix)\n } else {\n out(chalk.mediumgreen(`${testFilesText}`) + testFilesDetailsSuffix)\n }\n } else {\n out(chalk.mediumred(`${testFilesText}`) + testFilesDetailsSuffix)\n }\n\n // the tallies only cover what ran, so say the run was cut short - otherwise\n // \"Tests: 0/1\" reads as a one test suite\n const stoppedPlain = (stop.stopped)\n ? 'stopped at the first failure (failFast)'\n : ''\n if (stoppedPlain !== '') out(chalk.orange(stoppedPlain))\n\n const summaryLines = [\n testsText,\n joinPlain(describesText, describesThrownPlain, invalidDescribesPlain),\n joinPlain(testFilesText, failedToLoadPlain, invalidTestFilesPlain),\n ...(stoppedPlain === '') ? [] : [stoppedPlain]\n ]\n\n const durationMs = new Date().getTime() - runStartTime\n\n if (allPassed) {\n writeStatusFile(\n config, statusCodes.passed, 'all tests passed', summaryLines, durationMs\n )\n agentDone(\n config, agentRun, statusCodes.passed, 'all tests passed',\n testsResultsSummary, durationMs, state.failedTestFiles.size\n )\n } else {\n const abortedFiles = Object.keys(erroringTests)\n\n // a file that would not load, or a describe that threw, means the run died\n // partway - a different problem from tests that ran and failed\n const aborted = abortedFiles.length > 0 || describesThrownCount > 0\n const failedTestsCount = testsResultsSummary.itsTotal - testsResultsSummary.itsPasses\n\n const description = ([\n plural(abortedFiles.length, 'test file', 'failed to load or errored'),\n plural(describesThrownCount, 'describe', 'errored'),\n plural(failedTestsCount, 'test', 'failed')\n ].filter(part => part !== '').join(', ') || 'test run failed')\n + ((stop.stopped) ? ', stopped at the first failure' : '')\n\n const code = (aborted) ? statusCodes.aborted : statusCodes.failed\n const failures = failureEntries(Object.values(runTestResults), erroringTests)\n\n writeStatusFile(\n config,\n code,\n description,\n [...summaryLines, ...failureLines(Object.values(runTestResults), erroringTests)],\n durationMs\n )\n\n // failures first, so the done line is a complete end of run marker\n for (const failure of failures) agentFailure(config, agentRun, failure)\n agentDone(\n config, agentRun, code, description, testsResultsSummary, durationMs,\n state.failedTestFiles.size\n )\n }\n\n // full success?\n // true/false gets returned to the caller of runTests()\n return allPassed\n })\n } finally {\n if (reRunManager !== undefined) reRunManager.state.activeRuns--\n }\n}\n"]}
1
+ {"version":3,"file":"runTests.js","sourceRoot":"","sources":["../../../src/cli/lib/runTests.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE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AAC,EAAE,CAAC;gCAC3E,kBAAkB,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,CAAA;4BACrD,CAAC;wBACL,CAAC,CAAC,CAAA;wBAEF,iFAAiF;wBACjF,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,KAAK,YAAY;4BAAE,MAAM,kBAAkB,CAAC,QAAQ,CAAC,CAAA;oBACnF,CAAC;gBACL,CAAC;YACL,CAAC;QACL,CAAC,CAAC,CAAA;QAEF,IAAI,cAAc,GAA+B,EAAE,CAAA;QAEnD,MAAM,gBAAgB,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;YAC1D,cAAc,GAAG,MAAM,aAAa,CAAC,eAAe,CAAC,CAAA;YAErD,kCAAkC;YAClC,MAAM,aAAa,CAAC,kBAAkB,CAAC,CAAA;QAC3C,CAAC,CAAC,CAAA;QAEF,OAAO,sBAAsB,CACzB,cAAc,EAAE,aAAa,EAAE,YAAY,EAC3C,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,CACrD,CAAA;IAEL,CAAC;YAAS,CAAC;QACP,IAAI,YAAY,KAAK,SAAS;YAAE,YAAY,CAAC,KAAK,CAAC,UAAU,EAAE,CAAA;IACnE,CAAC;AACL,CAAC","sourcesContent":["\nimport { allObj as promiseAllObj } from 'sxy-lib/promises.js'\n\nimport type { FinalConfig, OutFn } from '../../types.js'\nimport type { TestExecutionFilters } from '../cliTypes.js'\nimport type { ReRunManager } from './reRunManager.js'\nimport { createTimeProfiler } from '../../packages/timeProfiler.js'\nimport { showTimeProfiling } from '../../config.js'\nimport { loadTestFile, type TestFile } from './loadTestFile.js'\nimport { runTest, type TestResult } from './runTest.js'\nimport { showTestLoadingError } from './showTestLoadingError.js'\nimport { showTestFileResult } from './showTestFileResult.js'\nimport { agentRunStart } from './agentReport.js'\nimport { makeStopSignal, stopIfFailFast } from './stopSignal.js'\nimport { makeRunManagerState, type ReRunManageState } from './makeWatchRunState.js'\nimport { showTestResultsSummary } from './showTestResultsSummary.js'\n\n\nconst { timeProfileAsync } = createTimeProfiler(showTimeProfiling)\n\nexport interface TestsResultsSummary {\n total: number\n passes: number\n invalid: number\n describesTotal: number\n describesPasses: number\n describesInvalid: number\n itsTotal: number\n itsPasses: number\n}\n\nexport type RunTestsPromise = Promise<boolean | null>\n\n\nexport type Concurrency = {\n limit: number\n}\n\nfunction recordEntitiesWithoutTests(state: ReRunManageState, testFile: string, testResult: TestResult): void {\n const describes = testResult.describeResults\n .filter(describeResult => describeResult.success === null)\n .map(describeResult => describeResult.thing)\n const fileWithoutTests = testResult.success === null\n if (fileWithoutTests || describes.length > 0) {\n state.withoutTests.set(testFile, {\n file: testResult.sourceFile ?? testResult.file, fileWithoutTests, describes\n })\n } else {\n state.withoutTests.delete(testFile)\n }\n}\n\nexport async function runTests(\n config: FinalConfig,\n testFiles: Set<string>,\n reRunManager: ReRunManager | undefined,\n concurrency: Concurrency = { limit: -1 }, // eslint-disable-line @typescript-eslint/no-unused-vars\n // -- WIP\n refresh: 'refresh' | 'cached' = 'refresh',\n customOut?: OutFn,\n filters: TestExecutionFilters = {}\n): RunTestsPromise {\n if (reRunManager !== undefined) {\n reRunManager.state.lastTestFiles = new Set(testFiles)\n reRunManager.state.activeRuns++ // whatever, obsolete. Can use it to check on things\n }\n\n const state = reRunManager?.state || makeRunManagerState()\n const runStartTime = new Date().getTime()\n const runNumber = agentRunStart(config, testFiles.size)\n const stop = makeStopSignal()\n //console.log('new runTests:', watchRunState?.activeRuns)\n //console.log(inspect(testFiles))\n\n try {\n const testRunPromises: Record<string, Promise<TestResult>> = {}\n const erroringTests: Record<string, TestFile> = {}\n const testRunOutPromises: Record<string, Promise<void>> = {}\n\n await timeProfileAsync('run tests', async () => {\n if (Array.isArray(testFiles) ? testFiles.length > 0 : testFiles.size > 0) {\n for (const testFile of testFiles) {\n //console.log('testFiles', testFiles)\n //console.log('testFile', testFile)\n\n // an earlier file failed under failFast - leave the rest unloaded\n if (stop.stopped) break\n\n const test = await loadTestFile(config, testFile, refresh)\n\n if (test.error !== undefined && test.error !== false) {\n erroringTests[testFile] = test\n state.failedTestFiles.add(testFile)\n showTestLoadingError(config, test, customOut)\n stopIfFailFast(config, stop, true)\n } else {\n const testRunPromise = runTest(config, test, filters, stop)\n testRunPromises[testFile] = testRunPromise\n\n testRunOutPromises[testFile] = testRunPromise.then(testResult => {\n if (testResult.success === true || testResult.success === null) {\n state.failedTestFiles.delete(testResult.file)\n } else {\n state.failedTestFiles.add(testFile)\n }\n const executionFilterActive = filters.describe !== undefined || filters.it !== undefined\n // a filter makes files and describes look empty when they are not\n if (!executionFilterActive) recordEntitiesWithoutTests(state, testFile, testResult)\n if (!executionFilterActive || testResult.describeResultsSummary.itsTotal > 0) {\n showTestFileResult(config, testResult, customOut)\n }\n })\n\n // wait for the test to complete before proceeding if we are in 'sequential' mode\n if (config.execution.files === 'sequential') await testRunOutPromises[testFile]\n }\n }\n }\n })\n\n let runTestResults: Record<string, TestResult> = {}\n\n await timeProfileAsync('wait for tests to finish', async () => {\n runTestResults = await promiseAllObj(testRunPromises)\n\n // wait for the output to complete\n await promiseAllObj(testRunOutPromises)\n })\n\n return showTestResultsSummary(\n runTestResults, erroringTests, runStartTime,\n config, runNumber, state, stop, filters, customOut\n )\n \n } finally {\n if (reRunManager !== undefined) reRunManager.state.activeRuns--\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=showFailuresColorized.d.ts.map
@@ -0,0 +1,52 @@
1
+ // import type { OutFn } from '../../types.js'
2
+ // import type { TestFile } from './loadTestFile.js'
3
+ // import type { TestResult } from './runTest.js'
4
+ // import chalk from '../../packages/chalk.js'
5
+ // import figures from '../../packages/figures.js'
6
+ // import { failureEntries } from './failureEntries.js'
7
+ export {};
8
+ // // The run's failures gathered in one place ahead of the tallies, one line per error. The full
9
+ // // diff, logs and trace stay in each file's own output above.
10
+ // export function showFailuresColorized(
11
+ // out: OutFn,
12
+ // testResults: TestResult[],
13
+ // erroringTests: Record<string, TestFile>
14
+ // ): void {
15
+ // const entries = failureEntries(testResults, erroringTests)
16
+ // if (entries.length === 0) return
17
+ // const displayNames = new Map<string, string>()
18
+ // for (const testResult of testResults) {
19
+ // displayNames.set(testResult.file, testResult.sourceFile ?? testResult.file)
20
+ // }
21
+ // for (const [file, test] of Object.entries(erroringTests)) {
22
+ // displayNames.set(file, test.sourceFile ?? file)
23
+ // }
24
+ // out(chalk.mediumred('Failures:'))
25
+ // let currentFile: string | undefined
26
+ // let currentDescribe: string | undefined
27
+ // // entries arrive in tree order, so a heading is needed only when its value changes
28
+ // for (const entry of entries) {
29
+ // if (entry.file !== currentFile) {
30
+ // out(chalk.grey(` ${displayNames.get(entry.file) ?? entry.file}`))
31
+ // currentFile = entry.file
32
+ // currentDescribe = undefined
33
+ // }
34
+ // if (entry.describe === undefined) {
35
+ // out(chalk.mediumred(` ${entry.error}`))
36
+ // continue
37
+ // }
38
+ // if (entry.describe !== currentDescribe) {
39
+ // const number = (entry.describeNumber === undefined) ? '' : `${entry.describeNumber}) `
40
+ // out(chalk.lightgrey(` ${number}`) + chalk.brightblue(entry.describe))
41
+ // currentDescribe = entry.describe
42
+ // }
43
+ // if (entry.test === undefined) {
44
+ // out(chalk.mediumred(` ${entry.error}`))
45
+ // } else {
46
+ // const letter = (entry.testLetter === undefined) ? '' : `${entry.testLetter}) `
47
+ // out(chalk.lightgrey(` ${letter}`) + chalk.mediumred(`${figures.cross} ${entry.test}`))
48
+ // out(chalk.mediumred(` ${entry.error}`))
49
+ // }
50
+ // }
51
+ // }
52
+ //# sourceMappingURL=showFailuresColorized.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"showFailuresColorized.js","sourceRoot":"","sources":["../../../src/cli/lib/showFailuresColorized.ts"],"names":[],"mappings":"AACA,8CAA8C;AAC9C,oDAAoD;AACpD,iDAAiD;AACjD,8CAA8C;AAC9C,kDAAkD;AAClD,uDAAuD;;AAGvD,iGAAiG;AACjG,gEAAgE;AAChE,yCAAyC;AACzC,kBAAkB;AAClB,iCAAiC;AACjC,8CAA8C;AAC9C,YAAY;AACZ,iEAAiE;AACjE,uCAAuC;AAEvC,qDAAqD;AACrD,8CAA8C;AAC9C,sFAAsF;AACtF,QAAQ;AACR,kEAAkE;AAClE,0DAA0D;AAC1D,QAAQ;AAER,wCAAwC;AAExC,0CAA0C;AAC1C,8CAA8C;AAE9C,0FAA0F;AAC1F,qCAAqC;AACrC,4CAA4C;AAC5C,iFAAiF;AACjF,uCAAuC;AACvC,0CAA0C;AAC1C,YAAY;AAEZ,8CAA8C;AAC9C,yDAAyD;AACzD,uBAAuB;AACvB,YAAY;AAEZ,oDAAoD;AACpD,qGAAqG;AACrG,uFAAuF;AACvF,+CAA+C;AAC/C,YAAY;AAEZ,0CAA0C;AAC1C,2DAA2D;AAC3D,mBAAmB;AACnB,6FAA6F;AAC7F,0GAA0G;AAC1G,6DAA6D;AAC7D,YAAY;AACZ,QAAQ;AACR,IAAI","sourcesContent":["\n// import type { OutFn } from '../../types.js'\n// import type { TestFile } from './loadTestFile.js'\n// import type { TestResult } from './runTest.js'\n// import chalk from '../../packages/chalk.js'\n// import figures from '../../packages/figures.js'\n// import { failureEntries } from './failureEntries.js'\n\n\n// // The run's failures gathered in one place ahead of the tallies, one line per error. The full\n// // diff, logs and trace stay in each file's own output above.\n// export function showFailuresColorized(\n// out: OutFn,\n// testResults: TestResult[],\n// erroringTests: Record<string, TestFile>\n// ): void {\n// const entries = failureEntries(testResults, erroringTests)\n// if (entries.length === 0) return\n\n// const displayNames = new Map<string, string>()\n// for (const testResult of testResults) {\n// displayNames.set(testResult.file, testResult.sourceFile ?? testResult.file)\n// }\n// for (const [file, test] of Object.entries(erroringTests)) {\n// displayNames.set(file, test.sourceFile ?? file)\n// }\n\n// out(chalk.mediumred('Failures:'))\n\n// let currentFile: string | undefined\n// let currentDescribe: string | undefined\n\n// // entries arrive in tree order, so a heading is needed only when its value changes\n// for (const entry of entries) {\n// if (entry.file !== currentFile) {\n// out(chalk.grey(` ${displayNames.get(entry.file) ?? entry.file}`))\n// currentFile = entry.file\n// currentDescribe = undefined\n// }\n\n// if (entry.describe === undefined) {\n// out(chalk.mediumred(` ${entry.error}`))\n// continue\n// }\n\n// if (entry.describe !== currentDescribe) {\n// const number = (entry.describeNumber === undefined) ? '' : `${entry.describeNumber}) `\n// out(chalk.lightgrey(` ${number}`) + chalk.brightblue(entry.describe))\n// currentDescribe = entry.describe\n// }\n\n// if (entry.test === undefined) {\n// out(chalk.mediumred(` ${entry.error}`))\n// } else {\n// const letter = (entry.testLetter === undefined) ? '' : `${entry.testLetter}) `\n// out(chalk.lightgrey(` ${letter}`) + chalk.mediumred(`${figures.cross} ${entry.test}`))\n// out(chalk.mediumred(` ${entry.error}`))\n// }\n// }\n// }\n"]}
@@ -0,0 +1,7 @@
1
+ import type { FinalConfig, OutFn } from '../../types.js';
2
+ import type { TestResult } from './runTest.js';
3
+ export interface ShowTestFileResultOptions {
4
+ failuresOnly?: boolean;
5
+ }
6
+ export declare function showTestFileResult(config: FinalConfig, testResult: TestResult, customOut?: OutFn, { failuresOnly }?: ShowTestFileResultOptions): void;
7
+ //# sourceMappingURL=showTestFileResult.d.ts.map
@@ -1,11 +1,9 @@
1
1
  import { inspect } from 'node:util';
2
2
  import chalk from '../../packages/chalk.js';
3
3
  import figures from '../../packages/figures.js';
4
- import { createTimeProfiler } from '../../packages/timeProfiler.js';
5
- import { showTimeProfiling } from '../../config.js';
6
4
  import { out as mainOut } from '../../output.js';
7
5
  import { indexNumberToLetters } from '../../indexNumberToLetters.js';
8
- const { timeProfileAsync } = createTimeProfiler(showTimeProfiling);
6
+ import { timeProfile } from './timeProfiler.js';
9
7
  function IsErrorLike(v) {
10
8
  return typeof v === 'object' && v !== null
11
9
  && 'name' in v && typeof v.name === 'string'
@@ -38,16 +36,20 @@ function showExpected(err, column) {
38
36
  }
39
37
  return showValue(err.expected, column);
40
38
  }
39
+ function describeFailed(describeResult) {
40
+ return describeResult.error !== undefined
41
+ || describeResult.itResults.some(itResult => itResult.success === false);
42
+ }
41
43
  function display(u) {
42
44
  if (typeof u === 'string')
43
45
  return u;
44
46
  return inspect(u);
45
47
  }
46
- export async function showTestResult(config, testResult, customOut) {
48
+ export function showTestFileResult(config, testResult, customOut, { failuresOnly = false } = {}) {
47
49
  const out = customOut ?? mainOut;
48
50
  // compact keeps only the blank line that separates files
49
51
  const gap = config.compact ? () => { } : () => { out(); };
50
- await timeProfileAsync('show test result', () => {
52
+ timeProfile('show test result', () => {
51
53
  out();
52
54
  const fileTime = (testResult.time === undefined) ? '' : ` ${testResult.time.toLocaleString()}ms`
53
55
  + ((testResult.loadTime === undefined)
@@ -55,7 +57,7 @@ export async function showTestResult(config, testResult, customOut) {
55
57
  : ` (${testResult.loadTime.toLocaleString()}ms module re-loading)`);
56
58
  out(chalk.grey `File ${testResult.sourceFile ?? testResult.file}${fileTime}`);
57
59
  const indent = ' ';
58
- if (testResult.logs.length > 0) {
60
+ if (!failuresOnly && testResult.logs.length > 0) {
59
61
  gap();
60
62
  out(chalk.grey `console.logs:`);
61
63
  testResult.logs.forEach(log => {
@@ -63,12 +65,14 @@ export async function showTestResult(config, testResult, customOut) {
63
65
  });
64
66
  gap();
65
67
  }
66
- if (testResult.describeResults.length === 0) {
68
+ if (!failuresOnly && testResult.describeResults.length === 0) {
67
69
  out('No describes');
68
70
  gap();
69
71
  }
70
72
  let first = true;
71
73
  for (const describeResult of testResult.describeResults) {
74
+ if (failuresOnly && !describeFailed(describeResult))
75
+ continue;
72
76
  if (!first)
73
77
  gap();
74
78
  first = false;
@@ -77,7 +81,7 @@ export async function showTestResult(config, testResult, customOut) {
77
81
  if (describeResult.itResults.length === 0 && !('error' in describeResult))
78
82
  out(`${indent}No tests`);
79
83
  gap();
80
- if (describeResult.logs && describeResult.logs.length > 0) {
84
+ if (!failuresOnly && describeResult.logs && describeResult.logs.length > 0) {
81
85
  out(chalk.grey `console.logs:`);
82
86
  describeResult.logs.forEach(log => {
83
87
  out(...log);
@@ -100,6 +104,8 @@ export async function showTestResult(config, testResult, customOut) {
100
104
  gap();
101
105
  }
102
106
  for (const itResult of describeResult.itResults) {
107
+ if (failuresOnly && itResult.success !== false)
108
+ continue;
103
109
  const letters = indexNumberToLetters(itResult.counter) ?? '';
104
110
  const itTime = chalk.grey ` ${itResult.time.toLocaleString()}ms`;
105
111
  if (itResult.success === true) {
@@ -150,4 +156,4 @@ export async function showTestResult(config, testResult, customOut) {
150
156
  }
151
157
  });
152
158
  }
153
- //# sourceMappingURL=showTestResult.js.map
159
+ //# sourceMappingURL=showTestFileResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"showTestFileResult.js","sourceRoot":"","sources":["../../../src/cli/lib/showTestFileResult.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKnC,OAAO,KAAK,MAAM,yBAAyB,CAAA;AAC3C,OAAO,OAAO,MAAM,2BAA2B,CAAA;AAC/C,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAmB/C,SAAS,WAAW,CAAC,CAAU;IAC3B,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI;WACnC,MAAM,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ;WACzC,SAAS,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ,CAAA;AAC1D,CAAC;AACD,SAAS,wBAAwB,CAAC,CAAY;IAC1C,OAAO,CAAC,QAAQ,IAAI,CAAC,IAAI,UAAU,IAAI,CAAC,CAAC,CAAA;AAC7C,CAAC;AAGD,0FAA0F;AAC1F,iFAAiF;AACjF,SAAS,YAAY,CAAC,OAAe,EAAE,MA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KAAK,CAAC,SAAS,CACf,GAAG,MAAM,GAAG,GAAG,CAAC,IAAI,KAAK,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,CAC/D,CAAC,CAAA;4BACN,CAAC;4BACD,cAAc;4BACd,IAAI,MAAM,CAAC,cAAc,IAAI,OAAO,IAAI,GAAG,EAAE,CAAC;gCAC1C,GAAG,EAAE,CAAA;gCACL,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;4BACvC,CAAC;wBACL,CAAC;6BAAM,CAAC;4BACJ,GAAG,CAAC,KAAK,CAAC,SAAS,CACf,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,CAC7B,CAAC,CAAA;wBACN,CAAC;oBACL,CAAC;gBACL,CAAC;gBAED,GAAG,EAAE,CAAA;gBACL,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC3B,GAAG,CAAC,KAAK,CAAC,IAAI,CAAA,eAAe,CAAC,CAAA;oBAC9B,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;wBACxB,GAAG,CAAC,GAAG,GAAG,CAAC,CAAA;oBACf,CAAC,CAAC,CAAA;oBACF,GAAG,EAAE,CAAA;gBACT,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC,CAAC,CAAA;AACN,CAAC","sourcesContent":["\nimport type { Expand } from 'sxy-lib/types/Expand.js'\nimport { inspect } from 'node:util'\n\nimport type { FinalConfig, OutFn } from '../../types.js'\nimport type { DescribeResult } from './runDescribe.js'\nimport type { TestResult } from './runTest.js'\nimport chalk from '../../packages/chalk.js'\nimport figures from '../../packages/figures.js'\nimport { out as mainOut } from '../../output.js'\nimport { indexNumberToLetters } from '../../indexNumberToLetters.js'\nimport { timeProfile } from './timeProfiler.js'\n\n\n// Assertion failures are recognised by shape, not by where they came from. Importing an\n// assertion library to test `instanceof` against cannot work here: the runner would need it\n// as a dependency, and the copy a test file throws from is a separate ESM instance anyway,\n// so the check fails for the very errors it is meant to catch.\n\n\ninterface ErrorLike {\n name: string\n message: string\n stack?: unknown\n cause?: unknown\n}\ninterface AssertionLike extends ErrorLike {\n actual?: unknown\n expected?: unknown\n}\nfunction IsErrorLike(v: unknown): v is Expand<ErrorLike> {\n return typeof v === 'object' && v !== null\n && 'name' in v && typeof v.name === 'string'\n && 'message' in v && typeof v.message === 'string'\n}\nfunction ErrorLikeIsAssertionLike(v: ErrorLike): v is Expand<AssertionLike> {\n return ('actual' in v || 'expected' in v)\n}\n\n\n// Node's assertion messages run to several lines. Later lines are indented to the message\n// column and blank ones dropped; a single line message passes through untouched.\nfunction alignMessage(message: string, spacer: string): string {\n return message.split('\\n').reduce<string[]>(\n (previous, line) => (previous.length === 0)\n ? [line]\n : (line.trim()) ? [...previous, spacer + line] : previous,\n []\n ).join('\\n')\n}\n\n// A multi line string is shown as text, indented under its label. inspect() would render it\n// as one quoted chunk per line joined with `+`, which buries the content it is there to\n// show. Everything else - objects, and single line strings, whose quotes reveal padding and\n// emptiness - still goes through inspect.\nfunction showValue(value: unknown, column: string): string {\n if (typeof value !== 'string' || !value.includes('\\n')) {\n return inspect(value, { depth: 5 })\n }\n return value.split('\\n').join(`\\n${column}`)\n}\n\n// sxy-assert describes an expected that is no single value (not null, instanceof) rather than carrying one\nfunction showExpected(err: AssertionLike, column: string): string {\n if (!('expected' in err) && 'expectedDescription' in err && typeof err.expectedDescription === 'string') {\n return err.expectedDescription\n }\n return showValue(err.expected, column)\n}\n\nfunction describeFailed(describeResult: DescribeResult): boolean {\n return describeResult.error !== undefined\n || describeResult.itResults.some(itResult => itResult.success === false)\n}\n\nfunction display(u: unknown): string {\n if (typeof u === 'string') return u\n return inspect(u)\n}\n\nexport interface ShowTestFileResultOptions {\n // for the summary: only what failed, and only the failing tests' own logs\n failuresOnly?: boolean\n}\n\nexport function showTestFileResult(\n config: FinalConfig,\n testResult: TestResult,\n customOut?: OutFn,\n { failuresOnly = false }: ShowTestFileResultOptions = {}\n): void {\n const out = customOut ?? mainOut\n // compact keeps only the blank line that separates files\n const gap = config.compact ? () => {} : () => { out() }\n\n timeProfile('show test result', () => {\n out()\n const fileTime = (testResult.time === undefined) ? '' : ` ${testResult.time.toLocaleString()}ms`\n + ((testResult.loadTime === undefined)\n ? ''\n : ` (${testResult.loadTime.toLocaleString()}ms module re-loading)`)\n out(chalk.grey`File ${testResult.sourceFile ?? testResult.file}${fileTime}`)\n\n const indent = ' '\n\n if (!failuresOnly && testResult.logs.length > 0) {\n gap()\n out(chalk.grey`console.logs:`)\n testResult.logs.forEach(log => {\n out(...log)\n })\n gap()\n }\n\n if (!failuresOnly && testResult.describeResults.length === 0) {\n out('No describes')\n gap()\n }\n\n let first = true\n\n for (const describeResult of testResult.describeResults) {\n if (failuresOnly && !describeFailed(describeResult)) continue\n\n if (!first) gap()\n first = false\n\n out(chalk.lightgrey`${describeResult.counter}) describing ` + chalk.brightblue(describeResult.thing)\n + chalk.grey` ${describeResult.time.toLocaleString()}ms`)\n if (describeResult.itResults.length === 0 && !('error' in describeResult)) out(`${indent}No tests`)\n gap()\n\n if (!failuresOnly && describeResult.logs && describeResult.logs.length > 0) {\n out(chalk.grey`console.logs:`)\n describeResult.logs.forEach(log => {\n out(...log)\n })\n gap()\n }\n\n if ('error' in describeResult) {\n const describeError = describeResult.error\n\n out(chalk.mediumred(`${indent}Threw:`))\n if (IsErrorLike(describeError)) {\n out(chalk.mediumred(`${indent}${describeError.name}: ${describeError.message}`))\n if (config.showErrorTrace && 'stack' in describeError) {\n gap()\n out(chalk.grey(display(describeError.stack)))\n }\n } else {\n out(chalk.mediumred(`${indent}${display(describeError)}`))\n }\n gap()\n }\n\n for (const itResult of describeResult.itResults) {\n if (failuresOnly && itResult.success !== false) continue\n\n const letters = indexNumberToLetters(itResult.counter) ?? ''\n const itTime = chalk.grey` ${itResult.time.toLocaleString()}ms`\n if (itResult.success === true) {\n out(chalk.lightgrey`${indent}${letters})`\n + chalk.mediumgreen` ${figures.tick} ${itResult.should}` + itTime)\n } else {\n out(chalk.lightgrey`${indent}${letters})`\n + chalk.mediumred` ${figures.cross} ${itResult.should}` + itTime)\n gap()\n const spacer = `${indent}${' '.repeat(letters.length)} `\n if ('error' in itResult) {\n const err = itResult.error\n if (IsErrorLike(err)) {\n if (ErrorLikeIsAssertionLike(err)) {\n out(chalk.mediumred(\n //`${spacer}Assertion Failed: ${alignMessage(err.message, spacer)}`\n `${spacer}${err.name}: ${alignMessage(err.message, spacer)}`\n ))\n // shown whenever the error carries them, so a falsy actual or\n // expected - 0, '', false, null - still gets its diff\n const valueColumn = `${spacer} `\n out(\n chalk.yellow`${spacer}Actual ${showValue(err.actual, valueColumn)}\\n`\n + chalk.brightblue`${spacer}Expected ${showExpected(err, valueColumn)}`\n )\n } else {\n out(chalk.mediumred(\n `${spacer}${err.name}: ${alignMessage(err.message, spacer)}`\n ))\n }\n // stack trace\n if (config.showErrorTrace && 'stack' in err) {\n gap()\n out(chalk.grey(display(err.stack)))\n }\n } else {\n out(chalk.mediumred(\n `${spacer}${display(err)}`\n ))\n }\n }\n }\n\n gap()\n if (itResult.logs.length > 0) {\n out(chalk.grey`console.logs:`)\n itResult.logs.forEach(log => {\n out(...log)\n })\n gap()\n }\n }\n }\n })\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import type { FinalConfig, OutFn } from '../../types.js';
2
+ import type { TestExecutionFilters } from '../cliTypes.js';
3
+ import type { TestFile } from './loadTestFile.js';
4
+ import type { ReRunManageState } from './makeWatchRunState.js';
5
+ import type { TestResult } from './runTest.js';
6
+ import type { StopSignal } from './stopSignal.js';
7
+ export declare function showTestResultsSummary(runTestResults: Record<string, TestResult>, erroringTests: Record<string, TestFile>, runStartTime: number, config: FinalConfig, runNumber: number, state: ReRunManageState, stop: StopSignal, filters: TestExecutionFilters, customOut?: OutFn): boolean | null;
8
+ //# sourceMappingURL=showTestResultsSummary.d.ts.map
@@ -0,0 +1,213 @@
1
+ import { count } from 'sxy-lib/objects.js';
2
+ import chalk from '../../packages/chalk.js';
3
+ import figures from '../../packages/figures.js';
4
+ import { agentDone, agentFailure } from './agentReport.js';
5
+ import { failureEntries } from './failureEntries.js';
6
+ import { failureLines } from './failureLines.js';
7
+ //import { showFailures } from './showFailures.js'
8
+ import { showTestFileResult } from './showTestFileResult.js';
9
+ import { showTestLoadingError } from './showTestLoadingError.js';
10
+ import { writeStatusFile, statusCodes } from './statusFile.js';
11
+ import { out as mainOut } from '../../output.js';
12
+ import { timeProfile } from './timeProfiler.js';
13
+ // the summary lines, minus the colouring, for the status file
14
+ function joinPlain(...parts) {
15
+ return parts.filter(part => part !== '').join(' ');
16
+ }
17
+ function plural(count, noun, verb) {
18
+ if (count < 1)
19
+ return '';
20
+ return `${count} ${noun}${count === 1 ? '' : 's'} ${verb}`;
21
+ }
22
+ export function showTestResultsSummary(runTestResults, erroringTests, runStartTime, config, runNumber, state, stop, filters, customOut) {
23
+ return timeProfile('show test run result summary', () => {
24
+ const out = customOut ?? mainOut;
25
+ const testsResultsSummary = {
26
+ total: 0,
27
+ passes: 0,
28
+ invalid: 0,
29
+ describesTotal: 0,
30
+ describesPasses: 0,
31
+ describesInvalid: 0,
32
+ itsTotal: 0,
33
+ itsPasses: 0
34
+ // itsInvalid: 0 // we don't check whether tests run any asserts (we don't control the assertion lib)
35
+ };
36
+ let describesThrownCount = 0;
37
+ for (const testFile in runTestResults) {
38
+ const runTestResult = runTestResults[testFile];
39
+ if (!runTestResult)
40
+ continue;
41
+ testsResultsSummary.total += +(runTestResult.success !== null);
42
+ testsResultsSummary.passes += +(runTestResult.success ?? false);
43
+ testsResultsSummary.invalid += +(runTestResult.success === null);
44
+ testsResultsSummary.describesTotal += runTestResult.describeResultsSummary.total;
45
+ testsResultsSummary.describesPasses += runTestResult.describeResultsSummary.passes;
46
+ testsResultsSummary.describesInvalid += runTestResult.describeResultsSummary.invalid;
47
+ testsResultsSummary.itsTotal += runTestResult.describeResultsSummary.itsTotal;
48
+ testsResultsSummary.itsPasses += runTestResult.describeResultsSummary.itsPasses;
49
+ describesThrownCount += runTestResult.describeResults
50
+ .filter(describeResult => describeResult.error !== undefined)
51
+ .length;
52
+ }
53
+ const failedToLoadCount = count(erroringTests);
54
+ testsResultsSummary.total += failedToLoadCount;
55
+ if ((filters.describe !== undefined || filters.it !== undefined)
56
+ && testsResultsSummary.itsTotal === 0
57
+ && failedToLoadCount === 0
58
+ && describesThrownCount === 0) {
59
+ out(chalk.orange('No tests matched the describe/test filters.'));
60
+ const durationMs = new Date().getTime() - runStartTime;
61
+ writeStatusFile(config, statusCodes.couldNotRun, 'no tests matched the describe/test filters', [], durationMs);
62
+ agentDone(config, runNumber, statusCodes.couldNotRun, 'no tests matched the describe/test filters', testsResultsSummary, durationMs, state.failedTestFiles.size);
63
+ return null;
64
+ }
65
+ const allPassed = (testsResultsSummary.passes === testsResultsSummary.total
66
+ && testsResultsSummary.describesPasses === testsResultsSummary.describesTotal
67
+ && testsResultsSummary.itsPasses === testsResultsSummary.itsTotal);
68
+ const failedTestsCount = testsResultsSummary.itsTotal - testsResultsSummary.itsPasses;
69
+ // a file that would not load, or a describe that threw, has no tests in itsTotal -
70
+ // each counts as one unit on both sides
71
+ const failuresN = failedTestsCount + describesThrownCount + failedToLoadCount;
72
+ const unitsN = testsResultsSummary.itsTotal + describesThrownCount + failedToLoadCount;
73
+ // the originals may have scrolled away on a long run, but past a point repeating
74
+ // them buries the tallies - and when everything failed, they are the whole output already
75
+ const showFailuresSection = config.restateFailures && failuresN > 0 && failuresN < unitsN
76
+ && (failuresN <= 10 || failuresN <= 1.7 * unitsN ** 0.58);
77
+ // the rule is separation enough, without the tallies' wider gap
78
+ out((config.compact || showFailuresSection) ? '' : '\n');
79
+ if (allPassed) {
80
+ out(chalk.mediumgreen(`${figures.tick}`));
81
+ }
82
+ else {
83
+ //showFailures(out, Object.values(runTestResults), erroringTests)
84
+ if (showFailuresSection) {
85
+ const hr = '='.repeat((process.stdout.columns ?? 41) - 1);
86
+ out(hr);
87
+ out('Failures:');
88
+ out(hr);
89
+ for (const test of Object.values(erroringTests))
90
+ showTestLoadingError(config, test, out);
91
+ for (const testResult of Object.values(runTestResults)) {
92
+ if (testResult.success !== false)
93
+ continue;
94
+ showTestFileResult(config, testResult, out, { failuresOnly: true });
95
+ }
96
+ out(config.compact ? '' : '\n');
97
+ }
98
+ out(chalk.mediumred(`${figures.cross}`));
99
+ }
100
+ // number of tests successful
101
+ const testsText = `Tests: ${testsResultsSummary.itsPasses}/${testsResultsSummary.itsTotal}`;
102
+ if (testsResultsSummary.itsPasses === testsResultsSummary.itsTotal) {
103
+ if (testsResultsSummary.itsTotal === 0) {
104
+ out(chalk.grey(`${testsText}`));
105
+ }
106
+ else {
107
+ out(chalk.mediumgreen(`${testsText}`));
108
+ }
109
+ }
110
+ else {
111
+ out(chalk.mediumred(`${testsText}`));
112
+ }
113
+ // number of items successful
114
+ const describesText = `Items: ${testsResultsSummary.describesPasses}/${testsResultsSummary.describesTotal}`;
115
+ const invalidDescribesPlain = (testsResultsSummary.describesInvalid >= 1)
116
+ ? (testsResultsSummary.describesInvalid === 1)
117
+ ? '(+1 describe without tests)'
118
+ : `(+${testsResultsSummary.describesInvalid} describes without tests)`
119
+ : '';
120
+ const describesThrownPlain = (describesThrownCount >= 1)
121
+ ? (describesThrownCount === 1)
122
+ ? '(1 describe errored)'
123
+ : `(${describesThrownCount} describes errored)`
124
+ : '';
125
+ const describesDetailsText = [
126
+ chalk.mediumred(describesThrownPlain), chalk.grey(invalidDescribesPlain)
127
+ ]
128
+ .filter(text => text !== '')
129
+ .join(' ');
130
+ const describesDetailsSuffix = describesDetailsText === '' ? '' : ` ${describesDetailsText}`;
131
+ if (testsResultsSummary.describesPasses === testsResultsSummary.describesTotal) {
132
+ if (testsResultsSummary.describesTotal === 0) {
133
+ out(chalk.grey(`${describesText}`) + describesDetailsSuffix);
134
+ }
135
+ else {
136
+ out(chalk.mediumgreen(`${describesText}`) + describesDetailsSuffix);
137
+ }
138
+ }
139
+ else {
140
+ out(chalk.mediumred(`${describesText}`) + describesDetailsSuffix);
141
+ }
142
+ // number of test files successful
143
+ const testFilesText = `Test Files: ${testsResultsSummary.passes}/${testsResultsSummary.total}`;
144
+ const invalidTestFilesPlain = (testsResultsSummary.invalid >= 1)
145
+ ? (testsResultsSummary.invalid === 1)
146
+ ? '(+1 file without tests)'
147
+ : `(+${testsResultsSummary.invalid} files without tests)`
148
+ : '';
149
+ const failedToLoadPlain = (failedToLoadCount >= 1)
150
+ ? (failedToLoadCount === 1)
151
+ ? '(1 file failed to load, or errored)'
152
+ : `(${failedToLoadCount} files failed to load, or errored)`
153
+ : '';
154
+ const testFilesDetailsText = [
155
+ chalk.mediumred(failedToLoadPlain), chalk.grey(invalidTestFilesPlain)
156
+ ]
157
+ .filter(text => text !== '')
158
+ .join(' ');
159
+ const testFilesDetailsSuffix = testFilesDetailsText === '' ? '' : ` ${testFilesDetailsText}`;
160
+ if (testsResultsSummary.passes === testsResultsSummary.total) {
161
+ if (testsResultsSummary.describesTotal === 0) {
162
+ out(chalk.grey(`${testFilesText}`) + testFilesDetailsSuffix);
163
+ }
164
+ else {
165
+ out(chalk.mediumgreen(`${testFilesText}`) + testFilesDetailsSuffix);
166
+ }
167
+ }
168
+ else {
169
+ out(chalk.mediumred(`${testFilesText}`) + testFilesDetailsSuffix);
170
+ }
171
+ // the tallies only cover what ran, so say the run was cut short - otherwise
172
+ // "Tests: 0/1" reads as a one test suite
173
+ const stoppedPlain = (stop.stopped)
174
+ ? 'stopped at the first failure (failFast)'
175
+ : '';
176
+ if (stoppedPlain !== '')
177
+ out(chalk.orange(stoppedPlain));
178
+ const summaryLines = [
179
+ testsText,
180
+ joinPlain(describesText, describesThrownPlain, invalidDescribesPlain),
181
+ joinPlain(testFilesText, failedToLoadPlain, invalidTestFilesPlain),
182
+ ...(stoppedPlain === '') ? [] : [stoppedPlain]
183
+ ];
184
+ const durationMs = new Date().getTime() - runStartTime;
185
+ if (allPassed) {
186
+ writeStatusFile(config, statusCodes.passed, 'all tests passed', summaryLines, durationMs);
187
+ agentDone(config, runNumber, statusCodes.passed, 'all tests passed', testsResultsSummary, durationMs, state.failedTestFiles.size);
188
+ }
189
+ else {
190
+ const abortedFiles = Object.keys(erroringTests);
191
+ // a file that would not load, or a describe that threw, means the run died
192
+ // partway - a different problem from tests that ran and failed
193
+ const aborted = abortedFiles.length > 0 || describesThrownCount > 0;
194
+ const description = ([
195
+ plural(abortedFiles.length, 'test file', 'failed to load or errored'),
196
+ plural(describesThrownCount, 'describe', 'errored'),
197
+ plural(failedTestsCount, 'test', 'failed')
198
+ ].filter(part => part !== '').join(', ') || 'test run failed')
199
+ + ((stop.stopped) ? ', stopped at the first failure' : '');
200
+ const code = (aborted) ? statusCodes.aborted : statusCodes.failed;
201
+ const failures = failureEntries(Object.values(runTestResults), erroringTests);
202
+ writeStatusFile(config, code, description, [...summaryLines, ...failureLines(Object.values(runTestResults), erroringTests)], durationMs);
203
+ // failures first, so the done line is a complete end of run marker
204
+ for (const failure of failures)
205
+ agentFailure(config, runNumber, failure);
206
+ agentDone(config, runNumber, code, description, testsResultsSummary, durationMs, state.failedTestFiles.size);
207
+ }
208
+ // full success?
209
+ // true/false gets returned to the caller of runTests()
210
+ return allPassed;
211
+ });
212
+ }
213
+ //# sourceMappingURL=showTestResultsSummary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"showTestResultsSummary.js","sourceRoot":"","sources":["../../../src/cli/lib/showTestResultsSummary.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAS1C,OAAO,KAAK,MAAM,yBAAyB,CAAA;AAC3C,OAAO,OAAO,MAAM,2BAA2B,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAA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YAE7E,eAAe,CACX,MAAM,EACN,IAAI,EACJ,WAAW,EACX,CAAC,GAAG,YAAY,EAAE,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,aAAa,CAAC,CAAC,EAChF,UAAU,CACb,CAAA;YAED,mEAAmE;YACnE,KAAK,MAAM,OAAO,IAAI,QAAQ;gBAAE,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;YACxE,SAAS,CACL,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,mBAAmB,EAAE,UAAU,EACrE,KAAK,CAAC,eAAe,CAAC,IAAI,CAC7B,CAAA;QACL,CAAC;QAED,gBAAgB;QAChB,uDAAuD;QACvD,OAAO,SAAS,CAAA;IACpB,CAAC,CAAC,CAAA;AACN,CAAC","sourcesContent":["\r\nimport { count } from 'sxy-lib/objects.js'\r\n\r\nimport type { FinalConfig, OutFn } from '../../types.js'\r\nimport type { TestExecutionFilters } from '../cliTypes.js'\r\nimport type { TestFile } from './loadTestFile.js'\r\nimport type { ReRunManageState } from './makeWatchRunState.js'\r\nimport type { TestResult } from './runTest.js'\r\nimport type { TestsResultsSummary } from './runTests.js'\r\nimport type { StopSignal } from './stopSignal.js'\r\nimport chalk from '../../packages/chalk.js'\r\nimport figures from '../../packages/figures.js'\r\nimport { agentDone, agentFailure } from './agentReport.js'\r\nimport { failureEntries } from './failureEntries.js'\r\nimport { failureLines } from './failureLines.js'\r\n//import { showFailures } from './showFailures.js'\r\nimport { showTestFileResult } from './showTestFileResult.js'\r\nimport { showTestLoadingError } from './showTestLoadingError.js'\r\nimport { writeStatusFile, statusCodes } from './statusFile.js'\r\nimport { out as mainOut } from '../../output.js'\r\nimport { timeProfile } from './timeProfiler.js'\r\n\r\n\r\n// the summary lines, minus the colouring, for the status file\r\nfunction joinPlain(...parts: string[]): string {\r\n return parts.filter(part => part !== '').join(' ')\r\n}\r\n\r\nfunction plural(count: number, noun: string, verb: string): string {\r\n if (count < 1) return ''\r\n return `${count} ${noun}${count === 1 ? '' : 's'} ${verb}`\r\n}\r\n\r\nexport function showTestResultsSummary(\r\n runTestResults: Record<string, TestResult>,\r\n erroringTests: Record<string, TestFile>,\r\n runStartTime: number,\r\n config: FinalConfig,\r\n runNumber: number,\r\n state: ReRunManageState,\r\n stop: StopSignal,\r\n filters: TestExecutionFilters,\r\n customOut?: OutFn,\r\n) {\r\n return timeProfile('show test run result summary', () => {\r\n \r\n const out = customOut ?? mainOut\r\n\r\n const testsResultsSummary: TestsResultsSummary = {\r\n total: 0,\r\n passes: 0,\r\n invalid: 0,\r\n describesTotal: 0,\r\n describesPasses: 0,\r\n describesInvalid: 0,\r\n itsTotal: 0,\r\n itsPasses: 0\r\n // itsInvalid: 0 // we don't check whether tests run any asserts (we don't control the assertion lib)\r\n }\r\n let describesThrownCount = 0\r\n\r\n for (const testFile in runTestResults) {\r\n const runTestResult = runTestResults[testFile]\r\n if (!runTestResult) continue\r\n\r\n testsResultsSummary.total += +(runTestResult.success !== null)\r\n testsResultsSummary.passes += +(runTestResult.success ?? false)\r\n testsResultsSummary.invalid += +(runTestResult.success === null)\r\n testsResultsSummary.describesTotal += runTestResult.describeResultsSummary.total\r\n testsResultsSummary.describesPasses += runTestResult.describeResultsSummary.passes\r\n testsResultsSummary.describesInvalid += runTestResult.describeResultsSummary.invalid\r\n testsResultsSummary.itsTotal += runTestResult.describeResultsSummary.itsTotal\r\n testsResultsSummary.itsPasses += runTestResult.describeResultsSummary.itsPasses\r\n describesThrownCount += runTestResult.describeResults\r\n .filter(describeResult => describeResult.error !== undefined)\r\n .length\r\n }\r\n\r\n const failedToLoadCount = count(erroringTests)\r\n testsResultsSummary.total += failedToLoadCount\r\n\r\n if (\r\n (filters.describe !== undefined || filters.it !== undefined)\r\n && testsResultsSummary.itsTotal === 0\r\n && failedToLoadCount === 0\r\n && describesThrownCount === 0\r\n ) {\r\n out(chalk.orange('No tests matched the describe/test filters.'))\r\n const durationMs = new Date().getTime() - runStartTime\r\n writeStatusFile(\r\n config,\r\n statusCodes.couldNotRun,\r\n 'no tests matched the describe/test filters',\r\n [],\r\n durationMs\r\n )\r\n agentDone(\r\n config, runNumber, statusCodes.couldNotRun,\r\n 'no tests matched the describe/test filters', testsResultsSummary, durationMs,\r\n state.failedTestFiles.size\r\n )\r\n return null\r\n }\r\n\r\n const allPassed = (\r\n testsResultsSummary.passes === testsResultsSummary.total\r\n && testsResultsSummary.describesPasses === testsResultsSummary.describesTotal\r\n && testsResultsSummary.itsPasses === testsResultsSummary.itsTotal\r\n )\r\n\r\n const failedTestsCount = testsResultsSummary.itsTotal - testsResultsSummary.itsPasses\r\n\r\n // a file that would not load, or a describe that threw, has no tests in itsTotal -\r\n // each counts as one unit on both sides\r\n const failuresN = failedTestsCount + describesThrownCount + failedToLoadCount\r\n const unitsN = testsResultsSummary.itsTotal + describesThrownCount + failedToLoadCount\r\n\r\n // the originals may have scrolled away on a long run, but past a point repeating\r\n // them buries the tallies - and when everything failed, they are the whole output already\r\n const showFailuresSection = config.restateFailures && failuresN > 0 && failuresN < unitsN\r\n && (failuresN <= 10 || failuresN <= 1.7 * unitsN ** 0.58)\r\n\r\n // the rule is separation enough, without the tallies' wider gap\r\n out((config.compact || showFailuresSection) ? '' : '\\n')\r\n\r\n if (allPassed) {\r\n out(chalk.mediumgreen(`${figures.tick}`))\r\n } else {\r\n //showFailures(out, Object.values(runTestResults), erroringTests)\r\n if (showFailuresSection) {\r\n \r\n const hr = '='.repeat((process.stdout.columns ?? 41) - 1)\r\n out(hr)\r\n out('Failures:')\r\n out(hr)\r\n\r\n for (const test of Object.values(erroringTests)) showTestLoadingError(config, test, out)\r\n for (const testResult of Object.values(runTestResults)) {\r\n if (testResult.success !== false) continue\r\n showTestFileResult(config, testResult, out, { failuresOnly: true })\r\n }\r\n out(config.compact ? '' : '\\n')\r\n }\r\n out(chalk.mediumred(`${figures.cross}`))\r\n }\r\n\r\n // number of tests successful\r\n const testsText = `Tests: ${testsResultsSummary.itsPasses}/${testsResultsSummary.itsTotal}`\r\n if (testsResultsSummary.itsPasses === testsResultsSummary.itsTotal) {\r\n if (testsResultsSummary.itsTotal === 0) {\r\n out(chalk.grey(`${testsText}`))\r\n } else {\r\n out(chalk.mediumgreen(`${testsText}`))\r\n }\r\n } else {\r\n out(chalk.mediumred(`${testsText}`))\r\n }\r\n\r\n // number of items successful\r\n const describesText = `Items: ${testsResultsSummary.describesPasses}/${testsResultsSummary.describesTotal}`\r\n const invalidDescribesPlain = (testsResultsSummary.describesInvalid >= 1)\r\n ? (testsResultsSummary.describesInvalid === 1)\r\n ? '(+1 describe without tests)'\r\n : `(+${testsResultsSummary.describesInvalid} describes without tests)`\r\n : ''\r\n const describesThrownPlain = (describesThrownCount >= 1)\r\n ? (describesThrownCount === 1)\r\n ? '(1 describe errored)'\r\n : `(${describesThrownCount} describes errored)`\r\n : ''\r\n const describesDetailsText = [\r\n chalk.mediumred(describesThrownPlain), chalk.grey(invalidDescribesPlain)\r\n ]\r\n .filter(text => text !== '')\r\n .join(' ')\r\n const describesDetailsSuffix = describesDetailsText === '' ? '' : ` ${describesDetailsText}`\r\n if (testsResultsSummary.describesPasses === testsResultsSummary.describesTotal) {\r\n if (testsResultsSummary.describesTotal === 0) {\r\n out(chalk.grey(`${describesText}`) + describesDetailsSuffix)\r\n } else {\r\n out(chalk.mediumgreen(`${describesText}`) + describesDetailsSuffix)\r\n }\r\n } else {\r\n out(chalk.mediumred(`${describesText}`) + describesDetailsSuffix)\r\n }\r\n\r\n // number of test files successful\r\n const testFilesText = `Test Files: ${testsResultsSummary.passes}/${testsResultsSummary.total}`\r\n const invalidTestFilesPlain = (testsResultsSummary.invalid >= 1)\r\n ? (testsResultsSummary.invalid === 1)\r\n ? '(+1 file without tests)'\r\n : `(+${testsResultsSummary.invalid} files without tests)`\r\n : ''\r\n const failedToLoadPlain = (failedToLoadCount >= 1)\r\n ? (failedToLoadCount === 1)\r\n ? '(1 file failed to load, or errored)'\r\n : `(${failedToLoadCount} files failed to load, or errored)`\r\n : ''\r\n const testFilesDetailsText = [\r\n chalk.mediumred(failedToLoadPlain), chalk.grey(invalidTestFilesPlain)\r\n ]\r\n .filter(text => text !== '')\r\n .join(' ')\r\n const testFilesDetailsSuffix = testFilesDetailsText === '' ? '' : ` ${testFilesDetailsText}`\r\n if (testsResultsSummary.passes === testsResultsSummary.total) {\r\n if (testsResultsSummary.describesTotal === 0) {\r\n out(chalk.grey(`${testFilesText}`) + testFilesDetailsSuffix)\r\n } else {\r\n out(chalk.mediumgreen(`${testFilesText}`) + testFilesDetailsSuffix)\r\n }\r\n } else {\r\n out(chalk.mediumred(`${testFilesText}`) + testFilesDetailsSuffix)\r\n }\r\n\r\n // the tallies only cover what ran, so say the run was cut short - otherwise\r\n // \"Tests: 0/1\" reads as a one test suite\r\n const stoppedPlain = (stop.stopped)\r\n ? 'stopped at the first failure (failFast)'\r\n : ''\r\n if (stoppedPlain !== '') out(chalk.orange(stoppedPlain))\r\n\r\n const summaryLines = [\r\n testsText,\r\n joinPlain(describesText, describesThrownPlain, invalidDescribesPlain),\r\n joinPlain(testFilesText, failedToLoadPlain, invalidTestFilesPlain),\r\n ...(stoppedPlain === '') ? [] : [stoppedPlain]\r\n ]\r\n\r\n const durationMs = new Date().getTime() - runStartTime\r\n\r\n if (allPassed) {\r\n writeStatusFile(\r\n config, statusCodes.passed, 'all tests passed', summaryLines, durationMs\r\n )\r\n agentDone(\r\n config, runNumber, statusCodes.passed, 'all tests passed',\r\n testsResultsSummary, durationMs, state.failedTestFiles.size\r\n )\r\n } else {\r\n const abortedFiles = Object.keys(erroringTests)\r\n\r\n // a file that would not load, or a describe that threw, means the run died\r\n // partway - a different problem from tests that ran and failed\r\n const aborted = abortedFiles.length > 0 || describesThrownCount > 0\r\n\r\n const description = ([\r\n plural(abortedFiles.length, 'test file', 'failed to load or errored'),\r\n plural(describesThrownCount, 'describe', 'errored'),\r\n plural(failedTestsCount, 'test', 'failed')\r\n ].filter(part => part !== '').join(', ') || 'test run failed')\r\n + ((stop.stopped) ? ', stopped at the first failure' : '')\r\n\r\n const code = (aborted) ? statusCodes.aborted : statusCodes.failed\r\n const failures = failureEntries(Object.values(runTestResults), erroringTests)\r\n\r\n writeStatusFile(\r\n config,\r\n code,\r\n description,\r\n [...summaryLines, ...failureLines(Object.values(runTestResults), erroringTests)],\r\n durationMs\r\n )\r\n\r\n // failures first, so the done line is a complete end of run marker\r\n for (const failure of failures) agentFailure(config, runNumber, failure)\r\n agentDone(\r\n config, runNumber, code, description, testsResultsSummary, durationMs,\r\n state.failedTestFiles.size\r\n )\r\n }\r\n\r\n // full success?\r\n // true/false gets returned to the caller of runTests()\r\n return allPassed\r\n })\r\n}\r\n"]}
@@ -0,0 +1,3 @@
1
+ declare const timeProfile: <T>(name: string, task: () => T) => T, timeProfileAsync: <T>(name: string, task: () => Promise<T>) => Promise<T>;
2
+ export { timeProfile, timeProfileAsync };
3
+ //# sourceMappingURL=timeProfiler.d.ts.map
@@ -2,4 +2,4 @@ import { createTimeProfiler } from '../../packages/timeProfiler.js';
2
2
  import { showTimeProfiling } from '../../config.js';
3
3
  const { timeProfile, timeProfileAsync } = createTimeProfiler(showTimeProfiling);
4
4
  export { timeProfile, timeProfileAsync };
5
- //# sourceMappingURL=timeProfier.js.map
5
+ //# sourceMappingURL=timeProfiler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeProfiler.js","sourceRoot":"","sources":["../../../src/cli/lib/timeProfiler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAGnD,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,GAAG,kBAAkB,CAAC,iBAAiB,CAAC,CAAA;AAE/E,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAA","sourcesContent":["\nimport { createTimeProfiler } from '../../packages/timeProfiler.js'\nimport { showTimeProfiling } from '../../config.js'\n\n\nconst { timeProfile, timeProfileAsync } = createTimeProfiler(showTimeProfiling)\n\nexport { timeProfile, timeProfileAsync }\n"]}
@@ -8,6 +8,9 @@ export function validateConfig(config, customOut) {
8
8
  if (typeof config.compact !== 'boolean') {
9
9
  doError('Config error, config.compact should be a boolean');
10
10
  }
11
+ if (typeof config.restateFailures !== 'boolean') {
12
+ doError('Config error, config.restateFailures should be a boolean');
13
+ }
11
14
  if (typeof config.agent !== 'boolean') {
12
15
  doError('Config error, config.agent should be a boolean');
13
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"validateConfig.js","sourceRoot":"","sources":["../../../src/cli/lib/validateConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAGhD,MAAM,UAAU,cAAc,CAAC,MAAmB,EAAE,SAAiB;IACjE,MAAM,GAAG,GAAG,SAAS,IAAI,OAAO,CAAA;IAEhC,SAAS,OAAO,CAAC,OAAe;QAC5B,GAAG,CAAC,OAAO,CAAC,CAAA;QACZ,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;IAC5B,CAAC;IAED,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QACtC,OAAO,CAAC,kDAAkD,CAAC,CAAA;IAC/D,CAAC;IAED,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QACpC,OAAO,CAAC,gDAAgD,CAAC,CAAA;IAC7D,CAAC;IAED,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QACjC,OAAO,CAAC,+CAA+C,CAAC,CAAA;IAC5D,CAAC;IAED,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,KAAK,UAAU,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,KAAK,YAAY,EAAE,CAAC;QACnF,OAAO,CAAC,+EAA+E,CAAC,CAAA;IAC5F,CAAC;IAED,IAAI,MAAM,CAAC,SAAS,CAAC,SAAS,KAAK,UAAU,IAAI,MAAM,CAAC,SAAS,CAAC,SAAS,KAAK,YAAY,EAAE,CAAC;QAC3F,OAAO,CAAC,mFAAmF,CAAC,CAAA;IAChG,CAAC;IAED,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,KAAK,UAAU,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,KAAK,YAAY,EAAE,CAAC;QACnF,OAAO,CAAC,+EAA+E,CAAC,CAAA;IAC5F,CAAC;IAED,IAAI,OAAO,MAAM,CAAC,KAAK,CAAC,oBAAoB,KAAK,SAAS,EAAE,CAAC;QACzD,OAAO,CAAC,qEAAqE,CAAC,CAAA;IAClF,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,UAAU,CAAA;IAC1C,IAAI,UAAU,KAAK,KAAK,IAAI,CAAC,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,KAAK,EAAE,CAAC,EAAE,CAAC;QAChF,OAAO,CAAC,sEAAsE,CAAC,CAAA;IACnF,CAAC;IAED,IAAI,OAAO,MAAM,CAAC,KAAK,CAAC,oBAAoB,KAAK,SAAS,EAAE,CAAC;QACzD,OAAO,CAAC,qEAAqE,CAAC,CAAA;IAClF,CAAC;AACL,CAAC","sourcesContent":["\nimport type { FinalConfig, OutFn } from '../../types.js'\nimport { out as mainOut } from '../../output.js'\n\n\nexport function validateConfig(config: FinalConfig, customOut?: OutFn): void {\n const out = customOut ?? mainOut\n\n function doError(message: string): never {\n out(message)\n throw new Error(message)\n }\n\n if (typeof config.compact !== 'boolean') {\n doError('Config error, config.compact should be a boolean')\n }\n\n if (typeof config.agent !== 'boolean') {\n doError('Config error, config.agent should be a boolean')\n }\n\n if (config.execution === undefined) {\n doError('Config error, config.execution is not defined')\n }\n\n if (config.execution.files !== 'parallel' && config.execution.files !== 'sequential') {\n doError('Config error, config.execution.files should be \\'parallel\\' or \\'sequential\\'')\n }\n\n if (config.execution.describes !== 'parallel' && config.execution.describes !== 'sequential') {\n doError('Config error, config.execution.describes should be \\'parallel\\' or \\'sequential\\'')\n }\n\n if (config.execution.tests !== 'parallel' && config.execution.tests !== 'sequential') {\n doError('Config error, config.execution.tests should be \\'parallel\\' or \\'sequential\\'')\n }\n\n if (typeof config.watch.ttyActionsOnKeypress !== 'boolean') {\n doError('Config error, config.watch.ttyActionsOnKeypress should be a boolean')\n }\n\n const statusFile = config.watch.statusFile\n if (statusFile !== false && (typeof statusFile !== 'string' || statusFile === '')) {\n doError('Config error, config.watch.statusFile should be false or a file path')\n }\n\n if (typeof config.watch.dependencyEvaluation !== 'boolean') {\n doError('Config error, config.watch.dependencyEvaluation should be a boolean')\n }\n}\n"]}
1
+ {"version":3,"file":"validateConfig.js","sourceRoot":"","sources":["../../../src/cli/lib/validateConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAGhD,MAAM,UAAU,cAAc,CAAC,MAAmB,EAAE,SAAiB;IACjE,MAAM,GAAG,GAAG,SAAS,IAAI,OAAO,CAAA;IAEhC,SAAS,OAAO,CAAC,OAAe;QAC5B,GAAG,CAAC,OAAO,CAAC,CAAA;QACZ,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;IAC5B,CAAC;IAED,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QACtC,OAAO,CAAC,kDAAkD,CAAC,CAAA;IAC/D,CAAC;IAED,IAAI,OAAO,MAAM,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;QAC9C,OAAO,CAAC,0DAA0D,CAAC,CAAA;IACvE,CAAC;IAED,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QACpC,OAAO,CAAC,gDAAgD,CAAC,CAAA;IAC7D,CAAC;IAED,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QACjC,OAAO,CAAC,+CAA+C,CAAC,CAAA;IAC5D,CAAC;IAED,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,KAAK,UAAU,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,KAAK,YAAY,EAAE,CAAC;QACnF,OAAO,CAAC,+EAA+E,CAAC,CAAA;IAC5F,CAAC;IAED,IAAI,MAAM,CAAC,SAAS,CAAC,SAAS,KAAK,UAAU,IAAI,MAAM,CAAC,SAAS,CAAC,SAAS,KAAK,YAAY,EAAE,CAAC;QAC3F,OAAO,CAAC,mFAAmF,CAAC,CAAA;IAChG,CAAC;IAED,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,KAAK,UAAU,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,KAAK,YAAY,EAAE,CAAC;QACnF,OAAO,CAAC,+EAA+E,CAAC,CAAA;IAC5F,CAAC;IAED,IAAI,OAAO,MAAM,CAAC,KAAK,CAAC,oBAAoB,KAAK,SAAS,EAAE,CAAC;QACzD,OAAO,CAAC,qEAAqE,CAAC,CAAA;IAClF,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,UAAU,CAAA;IAC1C,IAAI,UAAU,KAAK,KAAK,IAAI,CAAC,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,KAAK,EAAE,CAAC,EAAE,CAAC;QAChF,OAAO,CAAC,sEAAsE,CAAC,CAAA;IACnF,CAAC;IAED,IAAI,OAAO,MAAM,CAAC,KAAK,CAAC,oBAAoB,KAAK,SAAS,EAAE,CAAC;QACzD,OAAO,CAAC,qEAAqE,CAAC,CAAA;IAClF,CAAC;AACL,CAAC","sourcesContent":["\nimport type { FinalConfig, OutFn } from '../../types.js'\nimport { out as mainOut } from '../../output.js'\n\n\nexport function validateConfig(config: FinalConfig, customOut?: OutFn): void {\n const out = customOut ?? mainOut\n\n function doError(message: string): never {\n out(message)\n throw new Error(message)\n }\n\n if (typeof config.compact !== 'boolean') {\n doError('Config error, config.compact should be a boolean')\n }\n\n if (typeof config.restateFailures !== 'boolean') {\n doError('Config error, config.restateFailures should be a boolean')\n }\n\n if (typeof config.agent !== 'boolean') {\n doError('Config error, config.agent should be a boolean')\n }\n\n if (config.execution === undefined) {\n doError('Config error, config.execution is not defined')\n }\n\n if (config.execution.files !== 'parallel' && config.execution.files !== 'sequential') {\n doError('Config error, config.execution.files should be \\'parallel\\' or \\'sequential\\'')\n }\n\n if (config.execution.describes !== 'parallel' && config.execution.describes !== 'sequential') {\n doError('Config error, config.execution.describes should be \\'parallel\\' or \\'sequential\\'')\n }\n\n if (config.execution.tests !== 'parallel' && config.execution.tests !== 'sequential') {\n doError('Config error, config.execution.tests should be \\'parallel\\' or \\'sequential\\'')\n }\n\n if (typeof config.watch.ttyActionsOnKeypress !== 'boolean') {\n doError('Config error, config.watch.ttyActionsOnKeypress should be a boolean')\n }\n\n const statusFile = config.watch.statusFile\n if (statusFile !== false && (typeof statusFile !== 'string' || statusFile === '')) {\n doError('Config error, config.watch.statusFile should be false or a file path')\n }\n\n if (typeof config.watch.dependencyEvaluation !== 'boolean') {\n doError('Config error, config.watch.dependencyEvaluation should be a boolean')\n }\n}\n"]}