sxy-test-runner 2.4.11 → 2.4.13
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.
- package/dist/checkMeta.js.map +1 -1
- package/dist/cli/cliTypes.d.ts +12 -0
- package/dist/cli/cliTypes.js +3 -0
- package/dist/cli/cliTypes.js.map +1 -0
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/init.js +1 -1
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/lib/addBasePath.js.map +1 -1
- package/dist/cli/lib/addExports.js +6 -1
- package/dist/cli/lib/addExports.js.map +1 -1
- package/dist/cli/lib/agentReport.d.ts +2 -1
- package/dist/cli/lib/agentReport.js.map +1 -1
- package/dist/cli/lib/alwaysCacheBust.js.map +1 -1
- package/dist/cli/lib/applyConfigDefaults.js.map +1 -1
- package/dist/cli/lib/buildDependencyTree.js.map +1 -1
- package/dist/cli/lib/buildDependencyTrees.js.map +1 -1
- package/dist/cli/lib/consoleCapture.js.map +1 -1
- package/dist/cli/lib/defaultConfig.js.map +1 -1
- package/dist/cli/lib/doUserSetup.js +1 -1
- package/dist/cli/lib/doUserSetup.js.map +1 -1
- package/dist/cli/lib/doUserTeardown.js +1 -1
- package/dist/cli/lib/doUserTeardown.js.map +1 -1
- package/dist/cli/lib/exitCodes.js.map +1 -1
- package/dist/cli/lib/failureEntries.d.ts +2 -1
- package/dist/cli/lib/failureEntries.js +2 -0
- package/dist/cli/lib/failureEntries.js.map +1 -1
- package/dist/cli/lib/failureLines.d.ts +2 -1
- package/dist/cli/lib/failureLines.js.map +1 -1
- package/dist/cli/lib/filter.js.map +1 -1
- package/dist/cli/lib/findTestFiles.js.map +1 -1
- package/dist/cli/lib/findingTestsMessage.d.ts +1 -1
- package/dist/cli/lib/findingTestsMessage.js.map +1 -1
- package/dist/cli/lib/getAllowedFlags.d.ts +1 -1
- package/dist/cli/lib/getAllowedFlags.js.map +1 -1
- package/dist/cli/lib/globArgCombine.js.map +1 -1
- package/dist/cli/lib/handleUserInput.d.ts +2 -2
- package/dist/cli/lib/handleUserInput.js +1 -1
- package/dist/cli/lib/handleUserInput.js.map +1 -1
- package/dist/cli/lib/injectProperties.js.map +1 -1
- package/dist/cli/lib/isTest.js.map +1 -1
- package/dist/cli/lib/listenToUser.d.ts +3 -3
- package/dist/cli/lib/listenToUser.js +33 -8
- package/dist/cli/lib/listenToUser.js.map +1 -1
- package/dist/cli/lib/loadConfig.js.map +1 -1
- package/dist/cli/lib/loadTestFile.d.ts +10 -1
- package/dist/cli/lib/loadTestFile.js +23 -11
- package/dist/cli/lib/loadTestFile.js.map +1 -1
- package/dist/cli/lib/makeWatchRunState.js.map +1 -1
- package/dist/cli/lib/parseCommandLineArguments.d.ts +1 -1
- package/dist/cli/lib/parseCommandLineArguments.js.map +1 -1
- package/dist/cli/lib/parseDescribe.js +3 -3
- package/dist/cli/lib/parseDescribe.js.map +1 -1
- package/dist/cli/lib/reRunManager.d.ts +1 -1
- package/dist/cli/lib/reRunManager.js +1 -1
- package/dist/cli/lib/reRunManager.js.map +1 -1
- package/dist/cli/lib/reservedExportKeys.js.map +1 -1
- package/dist/cli/lib/resolveCommand.js.map +1 -1
- package/dist/cli/lib/runDescribe.d.ts +16 -1
- package/dist/cli/lib/runDescribe.js.map +1 -1
- package/dist/cli/lib/runDescribeRun.d.ts +2 -1
- package/dist/cli/lib/runDescribeRun.js +1 -1
- package/dist/cli/lib/runDescribeRun.js.map +1 -1
- package/dist/cli/lib/runIt.d.ts +9 -1
- package/dist/cli/lib/runIt.js +11 -7
- package/dist/cli/lib/runIt.js.map +1 -1
- package/dist/cli/lib/runTasks.d.ts +1 -1
- package/dist/cli/lib/runTasks.js +6 -4
- package/dist/cli/lib/runTasks.js.map +1 -1
- package/dist/cli/lib/runTest.d.ts +19 -1
- package/dist/cli/lib/runTest.js +4 -3
- package/dist/cli/lib/runTest.js.map +1 -1
- package/dist/cli/lib/runTests.d.ts +15 -3
- package/dist/cli/lib/runTests.js +25 -8
- package/dist/cli/lib/runTests.js.map +1 -1
- package/dist/cli/lib/showTestLoadingError.d.ts +2 -1
- package/dist/cli/lib/showTestLoadingError.js +1 -1
- package/dist/cli/lib/showTestLoadingError.js.map +1 -1
- package/dist/cli/lib/showTestResult.d.ts +2 -1
- package/dist/cli/lib/showTestResult.js +48 -45
- package/dist/cli/lib/showTestResult.js.map +1 -1
- package/dist/cli/lib/showTtyHelp.js.map +1 -1
- package/dist/cli/lib/shutdown.d.ts +1 -1
- package/dist/cli/lib/shutdown.js +11 -3
- package/dist/cli/lib/shutdown.js.map +1 -1
- package/dist/cli/lib/statusFile.js.map +1 -1
- package/dist/cli/lib/stopSignal.js.map +1 -1
- package/dist/cli/lib/timeProfier.js.map +1 -1
- package/dist/cli/lib/validateConfig.js.map +1 -1
- package/dist/cli/lib/watchFilesAndRunTests.js.map +1 -1
- package/dist/cli/lib/watchFilesAndRunTestsChokidar.js +3 -3
- package/dist/cli/lib/watchFilesAndRunTestsChokidar.js.map +1 -1
- package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.d.ts +5 -3
- package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.js +18 -11
- package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.js.map +1 -1
- package/dist/cli/lib/watchFilesChokidar.d.ts +1 -3
- package/dist/cli/lib/watchFilesChokidar.js +52 -43
- package/dist/cli/lib/watchFilesChokidar.js.map +1 -1
- package/dist/cli/lib/watchFilesNodeWatch.d.ts +2 -3
- package/dist/cli/lib/watchFilesNodeWatch.js +3 -3
- package/dist/cli/lib/watchFilesNodeWatch.js.map +1 -1
- package/dist/cli/once.js.map +1 -1
- package/dist/cli/version.js.map +1 -1
- package/dist/cli/watch.d.ts +2 -0
- package/dist/cli/watch.js +43 -18
- package/dist/cli/watch.js.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/describe.js +1 -1
- package/dist/describe.js.map +1 -1
- package/dist/indexNumberToLetters.js.map +1 -1
- package/dist/meta.js.map +1 -1
- package/dist/output.js +2 -0
- package/dist/output.js.map +1 -1
- package/dist/packages/chalk.js.map +1 -1
- package/dist/packages/esmReload.js.map +1 -1
- package/dist/packages/figures.js.map +1 -1
- package/dist/packages/loadConfig.js.map +1 -1
- package/dist/packages/mergeStructuredConfig.js.map +1 -1
- package/dist/packages/slash.js.map +1 -1
- package/dist/packages/timeProfiler.js.map +1 -1
- package/dist/types.d.ts +13 -81
- package/dist/types.js.map +1 -1
- package/package.json +5 -4
package/dist/checkMeta.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkMeta.js","sourceRoot":"","sources":["../src/checkMeta.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"checkMeta.js","sourceRoot":"","sources":["../src/checkMeta.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAGnC,6FAA6F;AAC7F,4FAA4F;AAC5F,oDAAoD;AACpD,MAAM,UAAU,SAAS,CAAC,OAAe,EAAE,IAAa,EAAE,IAAuB;IAC7E,MAAM,KAAK,GAAG,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,CAAC;QACrD,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,OAAO,KAAK,KAAK,SAAS,CAAC;QACjG,CAAC,CAAC,EAAE,CAAA;IAER,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAM;IAE9B,MAAM,IAAI,KAAK,CACX,GAAG,OAAO,sDAAsD;UAC9D,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,oCAAoC,OAAO,CAAC,IAAI,CAAC,EAAE,CAC5E,CAAA;AACL,CAAC","sourcesContent":["\nimport { inspect } from 'node:util'\n\n\n// Test files are .js as often as .ts, so the meta unions catch nothing there: a mistyped key\n// would be stored verbatim and silently flip execution the wrong way. Rejected at the point\n// it is written instead, while the file is loading.\nexport function checkMeta(context: string, meta: unknown, keys: readonly string[]): void {\n const named = (typeof meta === 'object' && meta !== null)\n ? Object.entries(meta).filter(([key, value]) => keys.includes(key) && typeof value === 'boolean')\n : []\n\n if (named.length === 1) return\n\n throw new Error(\n `${context} was given an invalid meta: expected exactly one of `\n + `${keys.join(' or ')}, with a boolean value. Received ${inspect(meta)}`\n )\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface AllowedArgument {
|
|
2
|
+
flag?: string;
|
|
3
|
+
hasValue: boolean;
|
|
4
|
+
}
|
|
5
|
+
export type AllowedArguments = Record<string, AllowedArgument>;
|
|
6
|
+
export type AllowedFlags = Record<string, string>;
|
|
7
|
+
export type ParsedArguments = Record<string, string | true>;
|
|
8
|
+
export interface TestExecutionFilters {
|
|
9
|
+
describe?: string;
|
|
10
|
+
it?: string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=cliTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cliTypes.js","sourceRoot":"","sources":["../../src/cli/cliTypes.ts"],"names":[],"mappings":"AACA,8EAA8E","sourcesContent":["\r\n// -- CLI argument parsing ---------------------------------------------------\r\n\r\nexport interface AllowedArgument {\r\n flag?: string\r\n hasValue: boolean\r\n}\r\n\r\nexport type AllowedArguments = Record<string, AllowedArgument>\r\nexport type AllowedFlags = Record<string, string>\r\nexport type ParsedArguments = Record<string, string | true>\r\n\r\nexport interface TestExecutionFilters {\r\n describe?: string\r\n it?: string\r\n}\r\n"]}
|
package/dist/cli/help.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"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C9C,yEAAyE;QACzE,oCAAoC;QACpC,EAAE;QACF,WAAW;QACX,KAAK,OAAO,EAAE;QACd,KAAK,OAAO,OAAO;QACnB,KAAK,OAAO,4CAA4C;QACxD,KAAK,OAAO,8BAA8B;QAC1C,KAAK,OAAO,mBAAmB;QAC/B,KAAK,OAAO,eAAe;QAC3B,KAAK,OAAO,mCAAmC;QAC/C,KAAK,OAAO,sCAAsC;QAClD,EAAE;QACF,kBAAkB,WAAW,OAAO,iBAAiB,GAAG;QACxD,uBAAuB,OAAO,eAAe,WAAW,GAAG;KAC9D,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;AACjB,CAAC","sourcesContent":["\nimport chalk from '../packages/chalk.js'\nimport { packageName, cliName, configFileNames, configLocations } from '../config.js'\nimport { out } from '../output.js'\n\n\nexport function help(): void {\n const configNames = configFileNames\n .map(name => `${name}.{js,cjs,mjs}`)\n .join(' or ')\n const configDirectories = configLocations\n .map(location => location === '' ? 'the project root' : `${location}/`)\n .join(' or ')\n\n out([\n chalk.brightblue(packageName),\n '',\n 'Usage:',\n ` ${cliName} [watch] [options]`,\n ` ${cliName} once [options]`,\n ` ${cliName} init`,\n ` ${cliName} help`,\n '',\n 'Commands:',\n ' watch Run tests and watch for related file changes (default)',\n ' once Run the test suite once and exit',\n ' init Create an initial configuration file',\n ' help Show this help',\n ' version Show the installed version',\n '',\n 'Options for watch and once:',\n ' -c, --config <file> Use a specific configuration file',\n ' -t, --test-files <glob> Override the configured test pattern',\n ' -f, --filter <glob> Further constrain the configured test pattern',\n ' -d, --filter-describe <substring> Run matching describe blocks',\n ' -i, --filter-it <substring> Run matching tests',\n ' --agent Report the run as single agent readable lines',\n ' -h, --help Show this help instead of running',\n ' -v, --version Show the installed version instead of running',\n '',\n 'Options for once only:',\n ' -x, --fail-fast Stop at the first failure',\n '',\n 'Options for watch only:',\n ' -s, --status-file <file> Write each run\\'s result to a file',\n '',\n 'An option not listed for the command it is given to is an error: the command exits',\n 'without running anything, rather than ignoring it.',\n '',\n 'Watch controls:',\n ' r/l + Enter Re-run the last set of tests',\n ' a + Enter Re-run all tests',\n ' f + Enter Re-run failing tests',\n ' Set watch.ttyActionsOnKeypress to true to run these without Enter',\n '',\n 'Exit codes for once:',\n ' 0 Everything passed',\n ' 20 Test errors - a failed assertion, a file that would not load, a describe that threw',\n ' 21 No test file matched the tests pattern',\n ' 22 Test files matched, but the name filters selected nothing in them',\n ' 23 An option was not recognised',\n '',\n 'Examples:',\n ` ${cliName}`,\n ` ${cliName} once`,\n ` ${cliName} watch --test-files \"**/*.focused.test.js\"`,\n ` ${cliName} once --filter \"**/users/**\"`,\n ` ${cliName} once --fail-fast`,\n ` ${cliName} once --agent`,\n ` ${cliName} watch --status-file .sxyt-status`,\n ` ${cliName} once --config config/sxyt.config.js`,\n '',\n `Configuration: ${configNames} in ${configDirectories}.`,\n `Executable aliases: ${cliName}, sxy-test, ${packageName}.`\n ].join('\\n'))\n}\n"]}
|
package/dist/cli/init.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { join } from 'path';
|
|
2
|
+
import fs from 'fs';
|
|
2
3
|
import chalk from '../packages/chalk.js';
|
|
3
4
|
import { packageName, cliName, configFileNames, configLocations } from '../config.js';
|
|
4
5
|
import { out } from '../output.js';
|
|
5
6
|
import { exitCodes } from './lib/exitCodes.js';
|
|
6
|
-
import fs from 'fs';
|
|
7
7
|
export function init() {
|
|
8
8
|
const projectDir = process.cwd();
|
|
9
9
|
for (const configLocation of configLocations) {
|
package/dist/cli/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,MAAM,IAAI,CAAA;AAEnB,OAAO,KAAK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AAgB,EAAE;cAC5E,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;cAC7D,uDAAuD,CAAC,CAAA;IAClE,CAAC;IAED,GAAG,CAAC,KAAK,CAAC,WAAW,CAAA,IAAI,WAAW,sBAAsB,GAAG,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAA;AAC9F,CAAC;AAED,sFAAsF;AACtF,SAAS,aAAa,CAAC,OAAe;IAClC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IAC7B,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;AACtC,CAAC","sourcesContent":["\nimport { join } from 'path'\nimport fs from 'fs'\n\nimport chalk from '../packages/chalk.js'\nimport { packageName, cliName, configFileNames, configLocations } from '../config.js'\nimport { out } from '../output.js'\nimport { exitCodes } from './lib/exitCodes.js'\n\n\nexport function init(): void {\n const projectDir = process.cwd()\n\n for (const configLocation of configLocations) {\n for (const configFileName of configFileNames) {\n let loc\n loc = join(projectDir, configLocation, configFileName + '.js')\n if (fs.existsSync(loc)) {\n configAlreadyExists(loc)\n }\n loc = join(projectDir, configLocation, configFileName + '.cjs')\n if (fs.existsSync(loc)) {\n configAlreadyExists(loc)\n }\n loc = join(projectDir, configLocation, configFileName + '.mjs')\n if (fs.existsSync(loc)) {\n configAlreadyExists(loc)\n }\n }\n }\n\n function configAlreadyExists(loc: string): never {\n reportAndExit(`[${packageName}] A matching config already exists at ${loc}`\n + `\\nPlease remove this config before generating a new one with \\`${cliName} init\\``)\n }\n\n const projectPackageJsonLocation = join(projectDir, 'package.json')\n if (!fs.existsSync(projectPackageJsonLocation)) {\n reportAndExit(`[${packageName}] No package.json exists in this location`\n + '\\nPlease initialise the package with `npm init` or `yarn init`'\n + ' before running this command, and run this command from the project root folder')\n }\n\n let packageJson: { type?: string }\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n packageJson = JSON.parse(fs.readFileSync(projectPackageJsonLocation, 'utf8'))\n } catch (error) {\n reportAndExit(`[${packageName}] Could not read the package.json at ${projectPackageJsonLocation}`\n + `\\n${error instanceof Error ? error.message : String(error)}`\n + '\\nPlease make sure the file is readable and contains valid JSON, then try again')\n }\n\n const targetConfigName = (packageJson.type === 'module')\n // ES6 module\n ? join(projectDir, configLocations[0] ?? '', configFileNames[0] + '.js')\n // common\n : join(projectDir, configLocations[0] ?? '', configFileNames[0] + '.mjs')\n\n const defaultConfig =\n `\n// @ts-check\n\n/** @type {import('sxy-test-runner').Config} */\nexport default {\n\n // base folder for tests match and ignore patterns\n testsBase: '.',\n\n // glob pattern or array of glob patterns of test files\n tests: [\n '**/*.sxyt.{js,mjs,jsx}',\n '**/*.test.{js,mjs,jsx}',\n '**/*.spec.{js,mjs,jsx}',\n '**/tests?/*.{js,mjs,jsx}',\n '**/__tests?__/*.{js,mjs,jsx}'\n ],\n\n // glob pattern or array of patterns of test files to ignore\n testsIgnore: ['**/node_modules/**'],\n\n // whether to show the full error trace when an error occurs in a test file\n showErrorTrace: false,\n\n\n // tasks to run on startup\n // accepts a function, file location (relative to project base), or array of functions and or files\n setup: undefined,\n\n // tasks to run before each test file is run\n beforeEachFile: undefined,\n\n // tasks to run after each test file is run\n afterEachFile: undefined,\n\n // tasks to run before each describe block is processed\n // if the function returns an object with named properties, or the file exports named exports,\n // these will be passed to the callback function in argument 0, and can be access by destructruing e.g.\n // describe('thing', ({exportA, exportB}) => { it('should', ...) })\n beforeEachDescribe: undefined,\n\n // tasks to run after each describe block\n afterEachDescribe: undefined,\n\n // tasks to run before each it/test block\n // function returns and file exports will be passed to the it/test block as with describe above, e.g.\n // it('should', ({exportA, exportB}) => { assert('something') })\n beforeEachTest: undefined,\n\n // tasks to run after each it/test block\n afterEachTest: undefined,\n\n // tasks to run once the whole run has finished\n teardown: undefined,\n\n // how to execute the different parts of test files\n execution: {\n\n // run test files in 'parallel' or 'sequential'ly\n files: 'sequential',\n\n // run describe blocks within a test file in 'parallel' or 'sequential'ly\n describes: 'sequential',\n\n // run it/test blocks within a describe blocks in 'parallel' or 'sequential'ly\n tests: 'sequential'\n\n },\n\n // watch mode configurations\n watch: {\n\n //// the base directory to watch files in\n watchFilesBase: '.',\n\n //// glob filter or array of glob filters of files to watch\n watchFiles: '**/*.js',\n\n //// glob filter or array of globl filters of files to ignore\n watchFilesIgnore: '**/node_modules/**',\n\n // run all tests when starting the watcher\n runAllOnStartup: true,\n\n // re run all previously failed tests on each test run, until they pass\n reRunFailingTests: true,\n\n // evaluate the dependencies of each test file, and re-run that test file only when they change. \n // Set this to false to re-run everything on any change\n dependencyEvaluation: true,\n\n // run watch mode keyboard commands immediately, without waiting for Enter\n ttyActionsOnKeypress: false,\n\n // file to write the latest run status to, or false for none\n statusFile: false,\n\n // report the session as single agent readable lines instead of the usual output\n agent: false,\n\n },\n\n}`\n\n try {\n fs.writeFileSync(targetConfigName, defaultConfig)\n } catch (error) {\n reportAndExit(`[${packageName}] Could not write the config to ${targetConfigName}`\n + `\\n${error instanceof Error ? error.message : String(error)}`\n + '\\nPlease check the folder is writable, then try again')\n }\n\n out(chalk.mediumgreen`[${packageName}] Created config at ` + chalk.blue(targetConfigName))\n}\n\n// init cannot continue past any of these, so they report in the error colour and stop\nfunction reportAndExit(message: string): never {\n out(chalk.mediumred(message))\n process.exit(exitCodes.usageError)\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addBasePath.js","sourceRoot":"","sources":["../../../src/cli/lib/addBasePath.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"addBasePath.js","sourceRoot":"","sources":["../../../src/cli/lib/addBasePath.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAG9C,MAAM,UAAU,WAAW,CAAC,IAAwB,EAAE,KAAkB;IACpE,OAAO,WAAW,CAAC,mBAAmB,EAAE,GAAG,EAAE;QACzC,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;YACpD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;gBACvB,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC;gBACtC,CAAC,CAAC,GAAG,IAAI,IAAI,KAAK,EAAE,CAAA;QAC5B,CAAC;QACD,OAAO,KAAK,CAAA;IAChB,CAAC,CAAC,CAAA;AACN,CAAC","sourcesContent":["\nimport type { GlobPattern } from '../../types.js'\nimport { timeProfile } from './timeProfier.js'\n\n\nexport function addBasePath(base: string | undefined, items: GlobPattern): GlobPattern {\n return timeProfile('add base to globs', () => {\n if (base !== undefined && base !== '.' && base !== '') {\n return Array.isArray(items)\n ? items.map(item => `${base}/${item}`)\n : `${base}/${items}`\n }\n return items\n })\n}\n"]}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { out } from '../../output.js';
|
|
2
|
+
// `event` is the hook the exports came from and `from` the individual task within it. Both are
|
|
3
|
+
// optional because a merge into an empty object cannot clash, so some callers have nothing
|
|
4
|
+
// useful to name.
|
|
2
5
|
export function addExports(exports, newProperties, event, from) {
|
|
3
6
|
for (const key in newProperties) {
|
|
4
7
|
if (key in exports) {
|
|
5
|
-
const
|
|
8
|
+
const hook = (event === undefined) ? 'task exports' : `'${event}' task exports`;
|
|
9
|
+
const source = (from === undefined) ? '' : ` from '${from}'`;
|
|
10
|
+
const message = `Error loading ${hook}${source}, key '${key}' has already been exported`;
|
|
6
11
|
out(message);
|
|
7
12
|
throw new Error(message);
|
|
8
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addExports.js","sourceRoot":"","sources":["../../../src/cli/lib/addExports.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"addExports.js","sourceRoot":"","sources":["../../../src/cli/lib/addExports.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAGrC,+FAA+F;AAC/F,2FAA2F;AAC3F,kBAAkB;AAClB,MAAM,UAAU,UAAU,CAAC,OAAoB,EAAE,aAA0B,EAAE,KAAc,EAAE,IAAa;IACtG,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;QAC9B,IAAI,GAAG,IAAI,OAAO,EAAE,CAAC;YACjB,MAAM,IAAI,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,KAAK,gBAAgB,CAAA;YAC/E,MAAM,MAAM,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,IAAI,GAAG,CAAA;YAC5D,MAAM,OAAO,GAAG,iBAAiB,IAAI,GAAG,MAAM,UAAU,GAAG,6BAA6B,CAAA;YACxF,GAAG,CAAC,OAAO,CAAC,CAAA;YACZ,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;QAC5B,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,CAAA;QACrC,CAAC;IACL,CAAC;AACL,CAAC","sourcesContent":["\nimport type { TaskExports } from '../../types.js'\nimport { out } from '../../output.js'\n\n\n// `event` is the hook the exports came from and `from` the individual task within it. Both are\n// optional because a merge into an empty object cannot clash, so some callers have nothing\n// useful to name.\nexport function addExports(exports: TaskExports, newProperties: TaskExports, event?: string, from?: string): void {\n for (const key in newProperties) {\n if (key in exports) {\n const hook = (event === undefined) ? 'task exports' : `'${event}' task exports`\n const source = (from === undefined) ? '' : ` from '${from}'`\n const message = `Error loading ${hook}${source}, key '${key}' has already been exported`\n out(message)\n throw new Error(message)\n } else {\n exports[key] = newProperties[key]\n }\n }\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { FinalConfig
|
|
1
|
+
import type { FinalConfig } from '../../types.js';
|
|
2
2
|
import type { FailureEntry } from './failureEntries.js';
|
|
3
3
|
import type { RunType } from './reRunManager.js';
|
|
4
|
+
import type { TestsResultsSummary } from './runTests.js';
|
|
4
5
|
import { type StatusCode } from './statusFile.js';
|
|
5
6
|
export type RunReason = RunType | 'startup' | 'once';
|
|
6
7
|
export declare function agentEnabled(config: FinalConfig): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentReport.js","sourceRoot":"","sources":["../../../src/cli/lib/agentReport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAKhD,OAAO,EAAE,WAAW,EAAmB,MAAM,iBAAiB,CAAA;AAE9D,2FAA2F;AAC3F,+EAA+E;AAC/E,EAAE;AACF,mDAAmD;AACnD,EAAE;AACF,4FAA4F;AAC5F,kFAAkF;AAElF,MAAM,MAAM,GAAG,QAAQ,CAAA;AAIvB,IAAI,UAAU,GAAG,CAAC,CAAA;AAClB,4FAA4F;AAC5F,+CAA+C;AAC/C,IAAI,aAAa,GAAc,SAAS,CAAA;AAIxC,SAAS,IAAI,CAAC,KAAa,EAAE,SAAkB,EAAE;IAC7C,OAAO,CAAC,MAAM,GAAG,IAAI,KAAK,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;AAC/F,CAAC;AAED,4FAA4F;AAC5F,SAAS,OAAO,CAAC,IAAY;IACzB,OAAO,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAA;AACzE,CAA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AAE,OAAM;IACjC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;AACxE,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,cAAc;IAC1B,8DAA8D;AAClE,CAAC","sourcesContent":["import { out as mainOut } from '../../output.js'\n\nimport type { FinalConfig, TestsResultsSummary } from '../../types.js'\nimport type { FailureEntry } from './failureEntries.js'\nimport type { RunType } from './reRunManager.js'\nimport { statusNames, type StatusCode } from './statusFile.js'\n\n// Agent mode reports a watch session as a stream of single lines, for a reader tailing the\n// process rather than watching the terminal. Every line is one complete event:\n//\n// [sxyt] <event> | <key>=<value> | <key>=<value>\n//\n// Values are never quoted, so free text is flattened to keep the grammar intact - one event\n// can never span two lines, and a stray `|` can never look like a field boundary.\n\nconst prefix = '[sxyt]'\n\nexport type RunReason = RunType | 'startup' | 'once'\n\nlet runCounter = 0\n// requestRun sets this before handing a run to runTests; the initial run never goes through\n// the queue, so 'startup' is the right default\nlet nextRunReason: RunReason = 'startup'\n\ntype Field = [string, string | number]\n\nfunction emit(event: string, fields: Field[] = []): void {\n mainOut(prefix + ` ${event}` + fields.map(([key, value]) => ` | ${key}=${value}`).join(''))\n}\n\n// newlines would split one event across two lines, and a `|` would read as a field boundary\nfunction flatten(text: string): string {\n return text.replace(/\\s*[\\r\\n]+\\s*/g, ' ').replace(/\\|/g, '/').trim()\n}\n\nexport function agentEnabled(config: FinalConfig): boolean {\n return config.watch.agent\n}\n\n// the process is up, before the config is even loaded - so a slow startup is\n// distinguishable from one that never began. Takes the flag rather than the config for that\n// reason, and resets the counters so repeated in process sessions start from 1.\nexport function agentInit(enabled: boolean): void {\n runCounter = 0\n nextRunReason = 'startup'\n if (!enabled) return\n emit('init', [['pid', process.pid]])\n}\n\nexport function agentFound(config: FinalConfig, files: number): void {\n if (!agentEnabled(config)) return\n emit('found', [['files', files]])\n}\n\nexport function agentSetRunReason(reason: RunReason): void {\n nextRunReason = reason\n}\n\n// claims the next run number and announces the run, so a reader knows work is in flight\n// before any result arrives\nexport function agentRunStart(config: FinalConfig, files: number): number {\n if (!agentEnabled(config)) return 0\n runCounter++\n emit('running', [\n ['n', runCounter],\n ['files', files],\n ['why', nextRunReason],\n ['covers', runScope(config)]\n ])\n return runCounter\n}\n\n// what the run was built from. A reader needs this to know how far the run's own `status`\n// generalises - only a run covering everything can speak for the whole suite.\nfunction runScope(config: FinalConfig): string {\n // known before the run starts: fail fast means it is built to stop early, so it cannot\n // promise to have covered anything beyond the first failure\n if (config.failFast) return 'until-first-failure'\n\n switch (nextRunReason) {\n case 'startup':\n case 'once':\n case 'all': return 'all'\n case 'last': return 'last'\n case 'failed': return 'failing'\n case 'auto': {\n // with dependency evaluation off a change runs the whole suite, so an auto run\n // carries the same weight as a startup one\n if (!config.watch.dependencyEvaluation) return 'all'\n // the reRunFailingTests case is the one worth spelling out: without it a run says\n // nothing about files that were already failing\n return (config.watch.reRunFailingTests) ? 'changed+failing' : 'changed'\n }\n default: return 'changed'\n }\n}\n\n// failures are emitted before the run's done line, so done is a complete end of run marker\nexport function agentFailure(config: FinalConfig, run: number, entry: FailureEntry): void {\n if (!agentEnabled(config)) return\n emit('fail', [\n ['n', run],\n ['file', flatten(entry.file)],\n ...(entry.describe === undefined)\n ? []\n : [['describe', flatten(entry.describe)] as Field],\n ...(entry.test === undefined) ? [] : [['test', flatten(entry.test)] as Field],\n ['error', flatten(entry.error)]\n ])\n}\n\n// `failing` counts the test files still failing across the whole session, not just this\n// run. A watch re-run usually covers only the changed files, so its own tallies can read as\n// a clean pass while the suite is still broken elsewhere.\nexport function agentDone(\n config: FinalConfig,\n run: number,\n code: StatusCode,\n description: string,\n summary: TestsResultsSummary | null,\n durationMs: number,\n failingFiles: number\n): void {\n if (!agentEnabled(config)) return\n emit('done', [\n ['n', run],\n // named, not numbered: `status=failed` needs no lookup table, and cannot be misread\n // as the process exit code the way a bare `code=1` could\n ['status', statusNames[code]],\n ['desc', flatten(description)],\n ...(summary === null) ? [] : [\n ['tests', `${summary.itsPasses}/${summary.itsTotal}`] as Field,\n ['items', `${summary.describesPasses}/${summary.describesTotal}`] as Field,\n ['files', `${summary.passes}/${summary.total}`] as Field\n ],\n ['failing', failingFiles],\n ['ms', durationMs]\n ])\n}\n\nexport function agentWatching(config: FinalConfig, files: number): void {\n if (!agentEnabled(config)) return\n emit('watching', [['files', files]])\n}\n\nexport function agentChange(config: FinalConfig, file: string, event: string): void {\n if (!agentEnabled(config)) return\n emit('change', [['file', flatten(file)], ['event', flatten(event)]])\n}\n\n// agent mode owns stdout, so the ordinary coloured output is routed into a sink\nexport function agentSilentOut(): void {\n // deliberately nothing - the agent lines are the whole stream\n}\n"]}
|
|
1
|
+
{"version":3,"file":"agentReport.js","sourceRoot":"","sources":["../../../src/cli/lib/agentReport.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,WAAW,EAAmB,MAAM,iBAAiB,CAAA;AAG9D,2FAA2F;AAC3F,+EAA+E;AAC/E,EAAE;AACF,mDAAmD;AACnD,EAAE;AACF,4FAA4F;AAC5F,kFAAkF;AAElF,MAAM,MAAM,GAAG,QAAQ,CAAA;AAIvB,IAAI,UAAU,GAAG,CAAC,CAAA;AAClB,4FAA4F;AAC5F,+CAA+C;AAC/C,IAAI,aAAa,GAAc,SAAS,CAAA;AAIxC,SAAS,IAAI,CAAC,KAAa,EAAE,SAAkB,EAAE;IAC7C,OAAO,CAAC,MAAM,GAAG,IAAI,KAAK,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;AAC/F,CAAC;AAED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AU,EAAE,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAA;AACxC,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,MAAmB,EAAE,IAAY,EAAE,KAAa;IACxE,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;QAAE,OAAM;IACjC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;AACxE,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,cAAc;IAC1B,8DAA8D;AAClE,CAAC","sourcesContent":["\nimport type { FinalConfig } from '../../types.js'\nimport type { FailureEntry } from './failureEntries.js'\nimport type { RunType } from './reRunManager.js'\nimport type { TestsResultsSummary } from './runTests.js'\nimport { out as mainOut } from '../../output.js'\nimport { statusNames, type StatusCode } from './statusFile.js'\n\n\n// Agent mode reports a watch session as a stream of single lines, for a reader tailing the\n// process rather than watching the terminal. Every line is one complete event:\n//\n// [sxyt] <event> | <key>=<value> | <key>=<value>\n//\n// Values are never quoted, so free text is flattened to keep the grammar intact - one event\n// can never span two lines, and a stray `|` can never look like a field boundary.\n\nconst prefix = '[sxyt]'\n\nexport type RunReason = RunType | 'startup' | 'once'\n\nlet runCounter = 0\n// requestRun sets this before handing a run to runTests; the initial run never goes through\n// the queue, so 'startup' is the right default\nlet nextRunReason: RunReason = 'startup'\n\ntype Field = [string, string | number]\n\nfunction emit(event: string, fields: Field[] = []): void {\n mainOut(prefix + ` ${event}` + fields.map(([key, value]) => ` | ${key}=${value}`).join(''))\n}\n\n// newlines would split one event across two lines, and a `|` would read as a field boundary\nfunction flatten(text: string): string {\n return text.replace(/\\s*[\\r\\n]+\\s*/g, ' ').replace(/\\|/g, '/').trim()\n}\n\nexport function agentEnabled(config: FinalConfig): boolean {\n return config.watch.agent\n}\n\n// the process is up, before the config is even loaded - so a slow startup is\n// distinguishable from one that never began. Takes the flag rather than the config for that\n// reason, and resets the counters so repeated in process sessions start from 1.\nexport function agentInit(enabled: boolean): void {\n runCounter = 0\n nextRunReason = 'startup'\n if (!enabled) return\n emit('init', [['pid', process.pid]])\n}\n\nexport function agentFound(config: FinalConfig, files: number): void {\n if (!agentEnabled(config)) return\n emit('found', [['files', files]])\n}\n\nexport function agentSetRunReason(reason: RunReason): void {\n nextRunReason = reason\n}\n\n// claims the next run number and announces the run, so a reader knows work is in flight\n// before any result arrives\nexport function agentRunStart(config: FinalConfig, files: number): number {\n if (!agentEnabled(config)) return 0\n runCounter++\n emit('running', [\n ['n', runCounter],\n ['files', files],\n ['why', nextRunReason],\n ['covers', runScope(config)]\n ])\n return runCounter\n}\n\n// what the run was built from. A reader needs this to know how far the run's own `status`\n// generalises - only a run covering everything can speak for the whole suite.\nfunction runScope(config: FinalConfig): string {\n // known before the run starts: fail fast means it is built to stop early, so it cannot\n // promise to have covered anything beyond the first failure\n if (config.failFast) return 'until-first-failure'\n\n switch (nextRunReason) {\n case 'startup':\n case 'once':\n case 'all': return 'all'\n case 'last': return 'last'\n case 'failed': return 'failing'\n case 'auto': {\n // with dependency evaluation off a change runs the whole suite, so an auto run\n // carries the same weight as a startup one\n if (!config.watch.dependencyEvaluation) return 'all'\n // the reRunFailingTests case is the one worth spelling out: without it a run says\n // nothing about files that were already failing\n return (config.watch.reRunFailingTests) ? 'changed+failing' : 'changed'\n }\n default: return 'changed'\n }\n}\n\n// failures are emitted before the run's done line, so done is a complete end of run marker\nexport function agentFailure(config: FinalConfig, run: number, entry: FailureEntry): void {\n if (!agentEnabled(config)) return\n emit('fail', [\n ['n', run],\n ['file', flatten(entry.file)],\n ...(entry.describe === undefined)\n ? []\n : [['describe', flatten(entry.describe)] as Field],\n ...(entry.test === undefined) ? [] : [['test', flatten(entry.test)] as Field],\n ['error', flatten(entry.error)]\n ])\n}\n\n// `failing` counts the test files still failing across the whole session, not just this\n// run. A watch re-run usually covers only the changed files, so its own tallies can read as\n// a clean pass while the suite is still broken elsewhere.\nexport function agentDone(\n config: FinalConfig,\n run: number,\n code: StatusCode,\n description: string,\n summary: TestsResultsSummary | null,\n durationMs: number,\n failingFiles: number\n): void {\n if (!agentEnabled(config)) return\n emit('done', [\n ['n', run],\n // named, not numbered: `status=failed` needs no lookup table, and cannot be misread\n // as the process exit code the way a bare `code=1` could\n ['status', statusNames[code]],\n ['desc', flatten(description)],\n ...(summary === null) ? [] : [\n ['tests', `${summary.itsPasses}/${summary.itsTotal}`] as Field,\n ['items', `${summary.describesPasses}/${summary.describesTotal}`] as Field,\n ['files', `${summary.passes}/${summary.total}`] as Field\n ],\n ['failing', failingFiles],\n ['ms', durationMs]\n ])\n}\n\nexport function agentWatching(config: FinalConfig, files: number): void {\n if (!agentEnabled(config)) return\n emit('watching', [['files', files]])\n}\n\nexport function agentChange(config: FinalConfig, file: string, event: string): void {\n if (!agentEnabled(config)) return\n emit('change', [['file', flatten(file)], ['event', flatten(event)]])\n}\n\n// agent mode owns stdout, so the ordinary coloured output is routed into a sink\nexport function agentSilentOut(): void {\n // deliberately nothing - the agent lines are the whole stream\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alwaysCacheBust.js","sourceRoot":"","sources":["../../../src/cli/lib/alwaysCacheBust.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"alwaysCacheBust.js","sourceRoot":"","sources":["../../../src/cli/lib/alwaysCacheBust.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAG1C,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAA","sourcesContent":["\r\nimport { envFlag } from '../../envFlag.js'\r\n\r\n\r\nexport const alwaysCacheBust = envFlag(process.env.SXYT_ALWAYS_CACHE_BUST)\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applyConfigDefaults.js","sourceRoot":"","sources":["../../../src/cli/lib/applyConfigDefaults.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"applyConfigDefaults.js","sourceRoot":"","sources":["../../../src/cli/lib/applyConfigDefaults.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAA;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGlD,MAAM,UAAU,mBAAmB,CAAC,UAA8B;IAC9D,MAAM,eAAe,GAAG;QACpB,SAAS,EAAE,EAAE;QACb,KAAK,EAAE,EAAE;KACZ,CAAA;IAED,OAAO,qBAAqB,CAAC,eAAe,EAAE,aAAa,EAAE,UAAU,CAAC,CAAA;AAC5E,CAAC","sourcesContent":["\nimport type { FinalConfig, UserConfigInternal } from '../../types.js'\nimport { mergeStructuredConfig } from '../../packages/mergeStructuredConfig.js'\nimport { defaultConfig } from './defaultConfig.js'\n\n\nexport function applyConfigDefaults(userConfig: UserConfigInternal): FinalConfig {\n const configStructure = {\n execution: {},\n watch: {}\n }\n\n return mergeStructuredConfig(configStructure, defaultConfig, userConfig)\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildDependencyTree.js","sourceRoot":"","sources":["../../../src/cli/lib/buildDependencyTree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buildDependencyTree.js","sourceRoot":"","sources":["../../../src/cli/lib/buildDependencyTree.ts"],"names":[],"mappings":"AACA,OAAO,cAAc,MAAM,iBAAiB,CAAA;AAG5C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,KAAK,MAAM,yBAAyB,CAAA;AAG3C,MAAM,UAAU,mBAAmB,CAAC,MAAmB,EAAE,QAAgB;IACrE,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAA;IAE1B,MAAM,oBAAoB,GAAG;QACzB,QAAQ;QACR,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,cAAc;QACtC,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;KAChE,CAAA;IAED,2EAA2E;IAC3E,6EAA6E;IAC7E,MAAM,EAAE,GAAG,cAAc,CAAC,oBAAoB,CAAwB,CAAA;IAEtE,wCAAwC;IACxC,sDAAsD;IACtD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;IACzB,MAAM,SAAS,GAAG,EAAE;SACf,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;SAC9C,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAA,CAAC,0BAA0B;IAEjE,KAAK,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAA;IAElC,OAAO,SAAS,CAAA;AACpB,CAAC","sourcesContent":["\nimport dependencyTree from 'dependency-tree'\n\nimport type { FinalConfig } from '../../types.js'\nimport { debug } from '../../output.js'\nimport slash from '../../packages/slash.js'\n\n\nexport function buildDependencyTree(config: FinalConfig, filename: string): string[] {\n filename = slash(filename)\n\n const dependencyTreeConfig = {\n filename,\n isListForm: true,\n directory: config.watch.watchFilesBase,\n filter: (path: string) => path.indexOf('node_modules') === -1\n }\n\n // isListForm:true makes dependency-tree return a flat string[] at runtime,\n // which its shipped types don't model (they only type the tree-object form).\n const dt = dependencyTree(dependencyTreeConfig) as unknown as string[]\n\n // process the results into final format\n // (forward slashes and convert full path to rel path)\n const cwd = process.cwd()\n const processed = dt\n .map(file => slash(file).slice(cwd.length + 1))\n .filter(file => file !== filename) // remove the current file\n\n debug('found dep tree', processed)\n\n return processed\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildDependencyTrees.js","sourceRoot":"","sources":["../../../src/cli/lib/buildDependencyTrees.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buildDependencyTrees.js","sourceRoot":"","sources":["../../../src/cli/lib/buildDependencyTrees.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAG9D,MAAM,EAAE,gBAAgB,EAAE,GAAG,kBAAkB,CAAC,iBAAiB,CAAC,CAAA;AAElE,MAAM,UAAU,oBAAoB,CAAC,MAAmB,EAAE,SAAsB;IAC5E,OAAO,gBAAgB,CAAC,wBAAwB,EAAE,GAAG,EAAE;QACnD,MAAM,eAAe,GAAoB,EAAE,CAAA;QAE3C,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YAC/B,MAAM,cAAc,GAAG,mBAAmB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;YAC5D,eAAe,CAAC,QAAQ,CAAC,GAAG,cAAc,CAAA;YAC1C,KAAK,CAAC,gBAAgB,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAA;QACtD,CAAC;QAED,OAAO,eAAe,CAAA;IAC1B,CAAC,CAAC,CAAA;AACN,CAAC","sourcesContent":["\nimport type { FinalConfig, DependencyTrees } from '../../types.js'\nimport { createTimeProfiler } from '../../packages/timeProfiler.js'\nimport { showTimeProfiling } from '../../config.js'\nimport { debug } from '../../output.js'\nimport { buildDependencyTree } from './buildDependencyTree.js'\n\n\nconst { timeProfileAsync } = createTimeProfiler(showTimeProfiling)\n\nexport function buildDependencyTrees(config: FinalConfig, testFiles: Set<string>): Promise<DependencyTrees> {\n return timeProfileAsync('build dependency trees', () => {\n const dependencyTrees: DependencyTrees = {}\n\n for (const testFile of testFiles) {\n const dependencyTree = buildDependencyTree(config, testFile)\n dependencyTrees[testFile] = dependencyTree\n debug('final dep tree', dependencyTrees[testFile])\n }\n\n return dependencyTrees\n })\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consoleCapture.js","sourceRoot":"","sources":["../../../src/cli/lib/consoleCapture.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"consoleCapture.js","sourceRoot":"","sources":["../../../src/cli/lib/consoleCapture.ts"],"names":[],"mappings":"AACA,+BAA+B;AAE/B,2FAA2F;AAC3F,4FAA4F;AAC5F,gFAAgF;AAChF,EAAE;AACF,6FAA6F;AAC7F,2FAA2F;AAC3F,2FAA2F;AAC3F,0BAA0B;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAGpD,MAAM,QAAQ,GAAG,IAAI,iBAAiB,EAAe,CAAA;AAErD,IAAI,UAA0C,CAAA;AAE9C,wFAAwF;AACxF,yFAAyF;AACzF,oCAAoC;AACpC,MAAM,UAAU,qBAAqB;IACjC,IAAI,UAAU,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,KAAK,UAAU;QAAE,OAAM;IAElE,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAA;IAC5B,UAAU,GAAG,CAAC,GAAG,KAAgB,EAAE,EAAE;QACjC,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAA;QAChC,IAAI,IAAI;YAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;;YACrB,QAAQ,CAAC,GAAG,KAAK,CAAC,CAAA;IAC3B,CAAC,CAAA;IACD,OAAO,CAAC,GAAG,GAAG,UAAU,CAAA;AAC5B,CAAC;AAED,yFAAyF;AACzF,0FAA0F;AAC1F,yFAAyF;AACzF,MAAM,UAAU,WAAW,CAAI,IAAiB,EAAE,IAAsB;IACpE,qBAAqB,EAAE,CAAA;IACvB,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AACnC,CAAC","sourcesContent":["\n/* eslint-disable no-console */\n\n// Capturing user console.log by swapping the global and restoring it afterwards only works\n// while nothing runs concurrently - two overlapping tests each save whatever they happen to\n// find and restore it out of order, which strands console.log on a dead buffer.\n//\n// Instead we install one console.log, once, and never reassign it. It asks AsyncLocalStorage\n// which test it is currently inside and appends to that test's buffer. Node propagates the\n// store across awaits, so concurrent tests each see their own, and there is no shared slot\n// for them to fight over.\n\nimport { AsyncLocalStorage } from 'node:async_hooks'\n\n\nconst logStore = new AsyncLocalStorage<unknown[][]>()\n\nlet dispatcher: typeof console.log | undefined\n\n// Safe to call repeatedly. Re-installs if something else has replaced console.log since\n// (the unit tests stub it per test case), taking the current console.log as the fallback\n// for output made outside any test.\nexport function installConsoleCapture(): void {\n if (dispatcher !== undefined && console.log === dispatcher) return\n\n const fallback = console.log\n dispatcher = (...texts: unknown[]) => {\n const logs = logStore.getStore()\n if (logs) logs.push(texts)\n else fallback(...texts)\n }\n console.log = dispatcher\n}\n\n// Runs body with logs as the active buffer - console.log made anywhere inside, including\n// after awaits, lands in it. Installs the capture on first use, so callers that reach the\n// run* functions directly rather than through the once/watch entry points still capture.\nexport function captureLogs<T>(logs: unknown[][], body: () => Promise<T>): Promise<T> {\n installConsoleCapture()\n return logStore.run(logs, body)\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultConfig.js","sourceRoot":"","sources":["../../../src/cli/lib/defaultConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"defaultConfig.js","sourceRoot":"","sources":["../../../src/cli/lib/defaultConfig.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,aAAa,GAAgB;IACtC,SAAS,EAAE,GAAG;IACd,KAAK,EAAE;QACH,wBAAwB;QACxB,wBAAwB;QACxB,wBAAwB;QACxB,0BAA0B;QAC1B,8BAA8B;KACjC;IACD,WAAW,EAAE,CAAC,oBAAoB,CAAC;IACnC,cAAc,EAAE,KAAK;IACrB,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,KAAK;IACf,SAAS,EAAE;QACP,KAAK,EAAE,YAAY;QACnB,SAAS,EAAE,YAAY;QACvB,KAAK,EAAE,YAAY;KACtB;IACD,KAAK,EAAE;QACH,cAAc,EAAE,GAAG;QACnB,UAAU,EAAE,SAAS;QACrB,gBAAgB,EAAE,oBAAoB;QACtC,eAAe,EAAE,IAAI;QACrB,iBAAiB,EAAE,IAAI;QACvB,oBAAoB,EAAE,IAAI;QAC1B,oBAAoB,EAAE,KAAK;QAC3B,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,KAAK;KACf;CACJ,CAAA","sourcesContent":["\nimport type { FinalConfig } from '../../types.js'\n\n\nexport const defaultConfig: FinalConfig = {\n testsBase: '.',\n tests: [\n '**/*.sxyt.{js,mjs,jsx}',\n '**/*.test.{js,mjs,jsx}',\n '**/*.spec.{js,mjs,jsx}',\n '**/tests?/*.{js,mjs,jsx}',\n '**/__tests?__/*.{js,mjs,jsx}'\n ],\n testsIgnore: ['**/node_modules/**'],\n showErrorTrace: false,\n compact: false,\n failFast: false,\n execution: {\n files: 'sequential',\n describes: 'sequential',\n tests: 'sequential'\n },\n watch: {\n watchFilesBase: '.',\n watchFiles: '**/*.js',\n watchFilesIgnore: '**/node_modules/**',\n runAllOnStartup: true,\n reRunFailingTests: true,\n dependencyEvaluation: true,\n ttyActionsOnKeypress: false,\n statusFile: false,\n agent: false\n }\n}\n"]}
|
|
@@ -10,7 +10,7 @@ export async function doUserSetup(config, progressOut = out) {
|
|
|
10
10
|
let setupFunctions = 0;
|
|
11
11
|
let setupFiles = 0;
|
|
12
12
|
for (const setupTask of setupTasks) {
|
|
13
|
-
switch (typeof setupTask) {
|
|
13
|
+
switch (typeof setupTask) { // eslint-disable-line @typescript-eslint/switch-exhaustiveness-check
|
|
14
14
|
case 'function': {
|
|
15
15
|
progressOut('Running setup function ' + String(++setupFunctions));
|
|
16
16
|
await setupTask();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doUserSetup.js","sourceRoot":"","sources":["../../../src/cli/lib/doUserSetup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doUserSetup.js","sourceRoot":"","sources":["../../../src/cli/lib/doUserSetup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAGrC,sFAAsF;AACtF,6FAA6F;AAC7F,sDAAsD;AACtD,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAAmB,EAAE,cAAqB,GAAG;IAC3E,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS;QAAE,OAAM;IAEtC,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAC9E,IAAI,cAAc,GAAG,CAAC,CAAA;IACtB,IAAI,UAAU,GAAG,CAAC,CAAA;IAClB,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,QAAQ,OAAO,SAAS,EAAE,CAAC,CAAC,qEAAqE;YAC7F,KAAK,UAAU,CAAC,CAAC,CAAC;gBACd,WAAW,CAAC,yBAAyB,GAAG,MAAM,CAAC,EAAE,cAAc,CAAC,CAAC,CAAA;gBACjE,MAAM,SAAS,EAAE,CAAA;gBACjB,MAAK;YACT,CAAC;YACD,KAAK,QAAQ,CAAC,CAAC,CAAC;gBACZ,WAAW,CAAC,qBAAqB,GAAG,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC,CAAA;gBAC5E,MAAM,MAAM,CAAC,UAAU,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,CAAC,EAAE,CAAC,CAAA;gBACxD,MAAK;YACT,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACN,GAAG,CAAC,mGAAmG,CAAC,CAAA;gBACxG,GAAG,CAAC,YAAY,OAAO,SAAS,GAAG,CAAC,CAAA;YACxC,CAAC;QACL,CAAC;IACL,CAAC;AACL,CAAC","sourcesContent":["\nimport { join } from 'path'\n\nimport type { FinalConfig, OutFn } from '../../types.js'\nimport { out } from '../../output.js'\n\n\n// progressOut carries the running-setup lines, so agent mode can sink them - they are\n// progress, not events, and would break its one-line-per-event stream. The errors below stay\n// on out: a broken setup entry is worth a stray line.\nexport async function doUserSetup(config: FinalConfig, progressOut: OutFn = out): Promise<void> {\n if (config.setup === undefined) return\n\n const setupTasks = Array.isArray(config.setup) ? config.setup : [config.setup]\n let setupFunctions = 0\n let setupFiles = 0\n for (const setupTask of setupTasks) {\n switch (typeof setupTask) { // eslint-disable-line @typescript-eslint/switch-exhaustiveness-check\n case 'function': {\n progressOut('Running setup function ' + String(++setupFunctions))\n await setupTask()\n break\n }\n case 'string': {\n progressOut('Running setup file ' + String(++setupFiles) + ': ' + setupTask)\n await import(`file://${join(process.cwd(), setupTask)}`)\n break\n }\n default: {\n out('Error: setup entry has an invalid type, expected \\'function\\' or \\'string\\' of an file to import.')\n out(`Received ${typeof setupTask}.`)\n }\n }\n }\n}\n"]}
|
|
@@ -5,7 +5,7 @@ export async function doUserTeardown(config) {
|
|
|
5
5
|
return;
|
|
6
6
|
const teardownTasks = Array.isArray(config.teardown) ? config.teardown : [config.teardown];
|
|
7
7
|
for (const teardownTask of teardownTasks) {
|
|
8
|
-
switch (typeof teardownTask) {
|
|
8
|
+
switch (typeof teardownTask) { // eslint-disable-line @typescript-eslint/switch-exhaustiveness-check
|
|
9
9
|
case 'function': {
|
|
10
10
|
await teardownTask();
|
|
11
11
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doUserTeardown.js","sourceRoot":"","sources":["../../../src/cli/lib/doUserTeardown.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doUserTeardown.js","sourceRoot":"","sources":["../../../src/cli/lib/doUserTeardown.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAGrC,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,MAAmB;IACpD,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS;QAAE,OAAM;IAEzC,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;IAC1F,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE,CAAC;QACvC,QAAQ,OAAO,YAAY,EAAE,CAAC,CAAC,qEAAqE;YAChG,KAAK,UAAU,CAAC,CAAC,CAAC;gBACd,MAAM,YAAY,EAAE,CAAA;gBACpB,MAAK;YACT,CAAC;YACD,KAAK,QAAQ,CAAC,CAAC,CAAC;gBACZ,MAAM,MAAM,CAAC,UAAU,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,YAAY,CAAC,EAAE,CAAC,CAAA;gBAC3D,MAAK;YACT,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACN,GAAG,CACC,gFAAgF;sBAC9E,wBAAwB,CAC7B,CAAA;gBACD,GAAG,CAAC,YAAY,OAAO,YAAY,GAAG,CAAC,CAAA;YAC3C,CAAC;QACL,CAAC;IACL,CAAC;AACL,CAAC","sourcesContent":["\nimport { join } from 'path'\n\nimport type { FinalConfig } from '../../types.js'\nimport { out } from '../../output.js'\n\n\nexport async function doUserTeardown(config: FinalConfig): Promise<void> {\n if (config.teardown === undefined) return\n\n const teardownTasks = Array.isArray(config.teardown) ? config.teardown : [config.teardown]\n for (const teardownTask of teardownTasks) {\n switch (typeof teardownTask) { // eslint-disable-line @typescript-eslint/switch-exhaustiveness-check\n case 'function': {\n await teardownTask()\n break\n }\n case 'string': {\n await import(`file://${join(process.cwd(), teardownTask)}`)\n break\n }\n default: {\n out(\n 'Error: teardown entry has an invalid type, expected \\'function\\' or \\'string\\''\n + ' of an file to import.'\n )\n out(`Received ${typeof teardownTask}.`)\n }\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exitCodes.js","sourceRoot":"","sources":["../../../src/cli/lib/exitCodes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exitCodes.js","sourceRoot":"","sources":["../../../src/cli/lib/exitCodes.ts"],"names":[],"mappings":"AACA,iCAAiC;AACjC,EAAE;AACF,0FAA0F;AAC1F,4FAA4F;AAC5F,yFAAyF;AACzF,uFAAuF;AACvF,yFAAyF;AACzF,qFAAqF;AACrF,EAAE;AACF,2FAA2F;AAC3F,6DAA6D;AAC7D,MAAM,CAAC,MAAM,SAAS,GAAG;IACrB,MAAM,EAAE,CAAC;IACT,oFAAoF;IACpF,wFAAwF;IACxF,UAAU,EAAE,EAAE;IACd,2DAA2D;IAC3D,WAAW,EAAE,EAAE;IACf,iFAAiF;IACjF,eAAe,EAAE,EAAE;IACnB,4EAA4E;IAC5E,UAAU,EAAE,EAAE;IACd,oFAAoF;IACpF,uFAAuF;IACvF,WAAW,EAAE,EAAE;CACT,CAAA","sourcesContent":["\n// Process exit codes for `once`.\n//\n// Node reserves 1-14 for its own fatal conditions, and anything over 128 is a signal exit\n// (128 + signal), with 126 and 127 taken by the shell for \"not executable\" and \"not found\".\n// 2 is left unused by Node because Bash uses it for builtin misuse. The whole range this\n// runner used to sit in - 3, 4, 5 - therefore overlapped Node's own codes, so a caller\n// could not tell \"the filters matched nothing\" from V8 dying. These start at 20 instead,\n// clear of every reserved range, so a non-zero code here is always the runner's own.\n//\n// These are process exit codes. They are NOT the status codes written by --status-file and\n// reported by --agent, which are a separate, smaller scheme.\nexport const exitCodes = {\n passed: 0,\n // tests ran and something was wrong with them: a failed assertion, a test file that\n // would not load, or a describe that threw. All are errors in the tests, not the runner\n testErrors: 20,\n // nothing to run: no test file matched the `tests` pattern\n noTestFiles: 21,\n // test files matched, but --filter-it/--filter-describe selected nothing in them\n noMatchingTests: 22,\n // an option was not recognised, or an option needing a value was given none\n usageError: 23,\n // reserved for a failure in the runner itself. Nothing emits it today - every known\n // failure is one of the above - but it keeps the category the original scheme intended\n runnerError: 24\n} as const\n\nexport type ExitCode = typeof exitCodes[keyof typeof exitCodes]\n"]}
|
|
@@ -64,6 +64,8 @@ function comparison(error, message) {
|
|
|
64
64
|
// one line and short: these lines are read in a status file or an agent stream, where a
|
|
65
65
|
// pretty-printed object would swamp everything around it. The terminal still has the full diff.
|
|
66
66
|
function summarise(value) {
|
|
67
|
+
/// TODO - is inspect safe here? We had problems with it for
|
|
68
|
+
/// showing diffs
|
|
67
69
|
const text = inspect(value, { depth: 2, breakLength: Infinity })
|
|
68
70
|
.replace(/\s*[\r\n]+\s*/g, ' ');
|
|
69
71
|
return (text.length > 60) ? `${text.slice(0, 60)}...` : text;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"failureEntries.js","sourceRoot":"","sources":["../../../src/cli/lib/failureEntries.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"failureEntries.js","sourceRoot":"","sources":["../../../src/cli/lib/failureEntries.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAgBnC,MAAM,UAAU,cAAc,CAC1B,WAAyB,EACzB,gBAA0C,EAAE;IAE5C,MAAM,OAAO,GAAmB,EAAE,CAAA;IAElC,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;QACvD,OAAO,CAAC,IAAI,CAAC,E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C,CAAC,CAAC,CAAC,GAAG,CAAA;IAClE,MAAM,QAAQ,GAAG,CAAC,UAAU,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;IACxE,OAAO,IAAI,MAAM,QAAQ,QAAQ,EAAE,CAAA;AACvC,CAAC;AAED,wFAAwF;AACxF,gGAAgG;AAChG,SAAS,SAAS,CAAC,KAAc;IAC7B,4DAA4D;IAC5D,iBAAiB;IACjB,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;SAC3D,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAA;IACnC,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA;AAChE,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;AAC5C,CAAC","sourcesContent":["\nimport { inspect } from 'node:util'\n\nimport type { TestResult } from './runTest.js'\nimport type { TestFile } from './loadTestFile.js'\n\n\n// One failure, flattened. `describe` is absent when a file would not load, and `test` is\n// absent when the describe itself threw. Shared by the status file's nested tree and the\n// agent reporter's flat lines, so both describe a failure the same way.\nexport interface FailureEntry {\n file: string\n describe?: string\n test?: string\n error: string\n}\n\nexport function failureEntries(\n testResults: TestResult[],\n erroringTests: Record<string, TestFile> = {}\n): FailureEntry[] {\n const entries: FailureEntry[] = []\n\n for (const [file, test] of Object.entries(erroringTests)) {\n entries.push({ file, error: `did not load: ${loadError(test.error)}` })\n }\n\n for (const testResult of testResults) {\n for (const describeResult of testResult.describeResults) {\n if (describeResult.error !== undefined) {\n entries.push({\n file: testResult.file,\n describe: describeResult.thing,\n error: `threw: ${simplifyError(describeResult.error)}`\n })\n }\n\n for (const itResult of describeResult.itResults) {\n if (itResult.success !== false) continue\n entries.push({\n file: testResult.file,\n describe: describeResult.thing,\n test: itResult.should,\n error: simplifyError(itResult.error)\n })\n }\n }\n }\n\n return entries\n}\n\n// the loader stores its own preamble with the real cause on the line below, so the first\n// line alone says only that loading failed - which `did not load` has already said. Drop the\n// preamble and keep the cause, flattened: an import error can run to several lines.\nfunction loadError(error: unknown): string {\n if (typeof error !== 'string') return simplifyError(error)\n\n const cause = error.replace(/^Error loading file\\r?\\n/, '').replace(/\\s*[\\r\\n]+\\s*/g, ' ').trim()\n if (cause === '') return 'Error loading file'\n return (cause.length > 200) ? `${cause.slice(0, 200)}...` : cause\n}\n\nfunction simplifyError(error: unknown): string {\n if (error === undefined || error === null || error === false) return 'unknown error'\n\n if (typeof error === 'object' && 'message' in error && typeof error.message === 'string') {\n const name = ('name' in error && typeof error.name === 'string') ? error.name : 'Error'\n return `${name}: ${firstLine(error.message)}${comparison(error, error.message)}`\n }\n\n // eslint-disable-next-line @typescript-eslint/no-base-to-string -- only a fallback\n return firstLine(String(error))\n}\n\n// node:assert's first line is only a preamble - \"Expected values to be strictly equal:\" -\n// with the compared values on the lines below, so the first line alone says nothing about\n// what went wrong. The values are on the error, so put them back. Chai fits its whole\n// message on one line and is left alone.\nfunction comparison(error: object, message: string): string {\n if (!message.includes('\\n')) return ''\n if (!('actual' in error) && !('expected' in error)) return ''\n\n const actual = ('actual' in error) ? summarise(error.actual) : '?'\n const expected = ('expected' in error) ? summarise(error.expected) : '?'\n return ` ${actual} !== ${expected}`\n}\n\n// one line and short: these lines are read in a status file or an agent stream, where a\n// pretty-printed object would swamp everything around it. The terminal still has the full diff.\nfunction summarise(value: unknown): string {\n /// TODO - is inspect safe here? We had problems with it for\n /// showing diffs\n const text = inspect(value, { depth: 2, breakLength: Infinity })\n .replace(/\\s*[\\r\\n]+\\s*/g, ' ')\n return (text.length > 60) ? `${text.slice(0, 60)}...` : text\n}\n\nfunction firstLine(text: string): string {\n return text.split('\\n')[0]?.trim() ?? ''\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TestResult } from './runTest.js';
|
|
2
|
+
import type { TestFile } from './loadTestFile.js';
|
|
2
3
|
export declare function failureLines(testResults: TestResult[], erroringTests?: Record<string, TestFile>): string[];
|
|
3
4
|
//# sourceMappingURL=failureLines.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"failureLines.js","sourceRoot":"","sources":["../../../src/cli/lib/failureLines.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"failureLines.js","sourceRoot":"","sources":["../../../src/cli/lib/failureLines.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAGpD,2FAA2F;AAC3F,wFAAwF;AACxF,YAAY;AACZ,MAAM,UAAU,YAAY,CACxB,WAAyB,EACzB,gBAA0C,EAAE;IAE5C,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,IAAI,WAA+B,CAAA;IACnC,IAAI,eAAmC,CAAA;IAEvC,mFAAmF;IACnF,KAAK,MAAM,KAAK,IAAI,cAAc,CAAC,WAAW,EAAE,aAAa,CAAC,EAAE,CAAC;QAC7D,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;YAC7B,KAAK,CAAC,IAAI,CAAC,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC,CAAA;YAChC,WAAW,GAAG,KAAK,CAAC,IAAI,CAAA;YACxB,eAAe,GAAG,SAAS,CAAA;QAC/B,CAAC;QAED,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC/B,KAAK,CAAC,IAAI,CAAC,UAAU,KAAK,CAAC,KAAK,EAAE,CAAC,CAAA;YACnC,SAAQ;QACZ,CAAC;QAED,IAAI,KAAK,CAAC,QAAQ,KAAK,eAAe,EAAE,CAAC;YACrC,KAAK,CAAC,IAAI,CAAC,UAAU,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;YACtC,eAAe,GAAG,KAAK,CAAC,QAAQ,CAAA;QACpC,CAAC;QAED,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC3B,KAAK,CAAC,IAAI,CAAC,YAAY,KAAK,CAAC,KAAK,EAAE,CAAC,CAAA;QACzC,CAAC;aAAM,CAAC;YACJ,KAAK,CAAC,IAAI,CAAC,YAAY,KAAK,CAAC,IAAI,EAAE,EAAE,cAAc,KAAK,CAAC,KAAK,EAAE,CAAC,CAAA;QACrE,CAAC;IACL,CAAC;IAED,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AAC5D,CAAC","sourcesContent":["\nimport type { TestResult } from './runTest.js'\nimport type { TestFile } from './loadTestFile.js'\nimport { failureEntries } from './failureEntries.js'\n\n\n// The failures for the status file, as f: file > d: describe > t: test > error. Errors are\n// reduced to a single line - anything wanting the diff, the logs or the trace reads the\n// terminal.\nexport function failureLines(\n testResults: TestResult[],\n erroringTests: Record<string, TestFile> = {}\n): string[] {\n const lines: string[] = []\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 failureEntries(testResults, erroringTests)) {\n if (entry.file !== currentFile) {\n lines.push(` f: ${entry.file}`)\n currentFile = entry.file\n currentDescribe = undefined\n }\n\n if (entry.describe === undefined) {\n lines.push(` e: ${entry.error}`)\n continue\n }\n\n if (entry.describe !== currentDescribe) {\n lines.push(` d: ${entry.describe}`)\n currentDescribe = entry.describe\n }\n\n if (entry.test === undefined) {\n lines.push(` e: ${entry.error}`)\n } else {\n lines.push(` t: ${entry.test}`, ` e: ${entry.error}`)\n }\n }\n\n return (lines.length > 0) ? ['Failures:', ...lines] : []\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.js","sourceRoot":"","sources":["../../../src/cli/lib/filter.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,WAAW,CAAA;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"filter.js","sourceRoot":"","sources":["../../../src/cli/lib/filter.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,WAAW,CAAA;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAGpD,MAAM,UAAU,MAAM,CAClB,SAAiB,EACjB,UAAkB,EAClB,QAAgB;IAEhB,MAAM,UAAU,GAAG,WAAW,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;IACrD,OAAO,SAAS,CAAC,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC,CAAA;AAC1D,CAAC","sourcesContent":["\nimport minimatch from 'minimatch'\n\nimport { addBasePath } from './addBasePath.js'\nimport { globArgCombine } from './globArgCombine.js'\n\n\nexport function filter(\n testsBase: string,\n testFilter: string,\n testFile: string,\n): boolean {\n const filterGlob = addBasePath(testsBase, testFilter)\n return minimatch(testFile, globArgCombine(filterGlob))\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findTestFiles.js","sourceRoot":"","sources":["../../../src/cli/lib/findTestFiles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"findTestFiles.js","sourceRoot":"","sources":["../../../src/cli/lib/findTestFiles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAGlC,OAAO,KAAK,MAAM,yBAAyB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGpC,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAAmB;IACnD,MAAM,UAAU,GAAG,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;IAC9D,MAAM,gBAAgB,GAAG,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,CAAA;IAE1E,mFAAmF;IACnF,kFAAkF;IAClF,qFAAqF;IACrF,MAAM,KAAK,GAAG,IAAI,GAAW,CAAA;IAC7B,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;QACtC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC;KACnF,CAAC,EAAE,CAAC;QACD,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,CAAA;QAC5B,IAAI,MAAM,CAAC,WAAW,KAAK,SAAS,IAAI,MAAM,CAAC,WAAW,KAAK,EAAE,EAAE,CAAC;YAChE,IAAI,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC;gBAAE,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACnF,CAAC;aAAM,CAAC;YACJ,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACvB,CAAC;IACL,CAAC;IAED,OAAO,KAAK,CAAA;AAChB,CAAC","sourcesContent":["\nimport { glob } from 'fs/promises'\n\nimport type { FinalConfig } from '../../types.js'\nimport slash from '../../packages/slash.js'\nimport { addBasePath } from './addBasePath.js'\nimport { filter } from './filter.js'\n\n\nexport async function findTestFiles(config: FinalConfig): Promise<Set<string>> {\n const testsGlobs = addBasePath(config.testsBase, config.tests)\n const testsIgnoreGlobs = addBasePath(config.testsBase, config.testsIgnore)\n\n // Node's built-in glob replaces the globby/tinyglobby dependency (no import cost).\n // It yields OS-native separators, so slash() restores the forward-slash paths the\n // rest of the runner relies on (watch-mode minimatch filters, dependency-tree keys).\n const files = new Set<string>\n for await (const file of glob(testsGlobs, {\n exclude: Array.isArray(testsIgnoreGlobs) ? testsIgnoreGlobs : [testsIgnoreGlobs]\n })) {\n const testFile = slash(file)\n if (config.testsFilter !== undefined && config.testsFilter !== '') {\n if (filter(config.testsBase, config.testsFilter, testFile)) files.add(testFile)\n } else {\n files.add(testFile)\n }\n }\n\n return files\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findingTestsMessage.js","sourceRoot":"","sources":["../../../src/cli/lib/findingTestsMessage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"findingTestsMessage.js","sourceRoot":"","sources":["../../../src/cli/lib/findingTestsMessage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,yBAAyB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAGzC,yGAAyG;AACzG,8CAA8C;AAC9C,QAAQ;AAER,qCAAqC;AACrC,4CAA4C;AAC5C,6DAA6D;AAC7D,kFAAkF;AAClF,YAAY;AACZ,oGAAoG;AAGpG,MAAM,UAAU,mBAAmB,CAAC,MAAmB;IACnD,MAAM,YAAY,GAAG,kBAAkB,CAAA;IACvC,IAAI,UAAU,GAAG,EAAE,CAAA;IACnB,IAAI,MAAM,CAAC,SAAS,KAAK,EAAE;QAAE,UAAU,IAAI,iBAAiB,MAAM,CAAC,SAAS,GAAG,CAAA;IAC/E,UAAU,IAAI,UAAU,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;QAC/C,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;QACxB,CAAC,CAAC,MAAM,CAAC,KAAK,GAAG,CAAA;IACrB,IAAI,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;QAC/B,UAAU,IAAI,kBAAkB,MAAM,CAAC,WAAW,GAAG,CAAA;IACzD,CAAC;IACD,IAAI,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;QAC/B,UAAU,IAAI,eAAe,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC;YAC1D,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC;YAC9B,CAAC,CAAC,MAAM,CAAC,WAAW,GAAG,CAAA;IAC/B,CAAC;IACD,OAAO,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;AAChD,CAAC","sourcesContent":["\r\nimport type { FinalConfig } from '../../types.js'\r\nimport chalk from '../../packages/chalk.js'\r\nimport { notEmpty } from './functions.js'\r\n\r\n\r\n// console.log('Looking for tests using pattern: ' + testFilesPattern) // eslint-disable-line no-console\r\n// userConfig.tests = testFilesPattern\r\n// }\r\n\r\n// if ('filter' in clArguments) {\r\n// const filter = clArguments.filter\r\n// if (typeof filter !== 'string' || filter === '') {\r\n// throw new Error('No pattern specified for --filter or -f argument')\r\n// }\r\n// console.log('Filtering tests using pattern: ' + filter) // eslint-disable-line no-console\r\n\r\n\r\nexport function findingTestsMessage(config: FinalConfig): string {\r\n const messageStart = 'finding tests...'\r\n let messageEnd = ''\r\n if (config.testsBase !== '') messageEnd += `\\nlooking in '${config.testsBase}'`\r\n messageEnd += `\\nfor '${Array.isArray(config.tests)\r\n ? config.tests.join(',')\r\n : config.tests}'`\r\n if (notEmpty(config.testsFilter)) {\r\n messageEnd += `\\nfiltered by '${config.testsFilter}'`\r\n }\r\n if (notEmpty(config.testsIgnore)) {\r\n messageEnd += `\\nignoring '${Array.isArray(config.testsIgnore)\r\n ? config.testsIgnore.join(',')\r\n : config.testsIgnore}'`\r\n }\r\n return messageStart + chalk.grey(messageEnd)\r\n}\r\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { AllowedArguments, AllowedFlags } from '
|
|
1
|
+
import type { AllowedArguments, AllowedFlags } from '../cliTypes.js';
|
|
2
2
|
export declare function getAllowedFlags(allowedArguments: AllowedArguments): AllowedFlags;
|
|
3
3
|
//# sourceMappingURL=getAllowedFlags.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAllowedFlags.js","sourceRoot":"","sources":["../../../src/cli/lib/getAllowedFlags.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getAllowedFlags.js","sourceRoot":"","sources":["../../../src/cli/lib/getAllowedFlags.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,eAAe,CAAC,gBAAkC;IAC9D,MAAM,YAAY,GAAiB,EAAE,CAAA;IACrC,KAAK,MAAM,MAAM,IAAI,gBAAgB,EAAE,CAAC;QACpC,MAAM,QAAQ,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAA;QACzC,IAAI,OAAO,QAAQ,EAAE,IAAI,KAAK,QAAQ,EAAE,CAAC;YACrC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,CAAA;QACxC,CAAC;IACL,CAAC;IACD,OAAO,YAAY,CAAA;AACvB,CAAC","sourcesContent":["\nimport type { AllowedArguments, AllowedFlags } from '../cliTypes.js'\n\n\nexport function getAllowedFlags(allowedArguments: AllowedArguments): AllowedFlags {\n const allowedFlags: AllowedFlags = {}\n for (const option in allowedArguments) {\n const argument = allowedArguments[option]\n if (typeof argument?.flag === 'string') {\n allowedFlags[argument.flag] = option\n }\n }\n return allowedFlags\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globArgCombine.js","sourceRoot":"","sources":["../../../src/cli/lib/globArgCombine.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"globArgCombine.js","sourceRoot":"","sources":["../../../src/cli/lib/globArgCombine.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,cAAc,CAAC,QAAqB;IAChD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;QAAE,OAAO,QAAQ,CAAA;IAC7C,OAAO,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;QACxB,CAAC,CAAC,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG;QAChC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;AAC7B,CAAC","sourcesContent":["\nimport type { GlobPattern } from '../../types.js'\n\n\nexport function globArgCombine(patterns: GlobPattern): string {\n if (!Array.isArray(patterns)) return patterns\n return (patterns.length > 1)\n ? '{' + patterns.join(',') + '}'\n : (patterns[0] ?? '')\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ReRunManager } from './reRunManager.js';
|
|
2
|
+
import type { RerunTestsFactory } from './listenToUser.js';
|
|
3
3
|
export declare function handleUserInput(input: string, reRunManager: ReRunManager, rerunTestsCallback: RerunTestsFactory): void;
|
|
4
4
|
//# sourceMappingURL=handleUserInput.d.ts.map
|
|
@@ -27,6 +27,6 @@ export function handleUserInput(input, reRunManager, rerunTestsCallback) {
|
|
|
27
27
|
out('No suitable test files to run');
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
|
-
reRunManager.requestRun(type, rerunTestsCallback(new Set(testFiles))); /// CHECK is it appropriate to copy here?
|
|
30
|
+
void reRunManager.requestRun(type, rerunTestsCallback(new Set(testFiles))); /// CHECK is it appropriate to copy here?
|
|
31
31
|
}
|
|
32
32
|
//# sourceMappingURL=handleUserInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleUserInput.js","sourceRoot":"","sources":["../../../src/cli/lib/handleUserInput.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handleUserInput.js","sourceRoot":"","sources":["../../../src/cli/lib/handleUserInput.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAGrC,MAAM,UAAU,eAAe,CAC3B,KAAa,EACb,YAA0B,EAC1B,kBAAqC;IAErC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;IAE1C,iCAAiC;IAEjC,mEAAmE;IACnE,wDAAwD;IAExD,IAAI,IAAa,CAAA;IACjB,IAAI,SAAsB,CAAA;IAC1B,IAAI,OAAO,KAAK,GAAG,IAAI,OAAO,KAAK,GAAG,EAAE,CAAC;QACrC,IAAI,GAAG,MAAM,CAAA;QACb,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,aAAa,CAAA;IAChD,CAAC;SAAM,IAAI,OAAO,KAAK,GAAG,EAAE,CAAC;QACzB,IAAI,GAAG,KAAK,CAAA;QACZ,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,YAAY,CAAA;IAC/C,CAAC;SAAM,IAAI,OAAO,KAAK,GAAG,EAAE,CAAC;QACzB,IAAI,GAAG,QAAQ,CAAA;QACf,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,eAAe,CAAA;IAClD,CAAC;SAAM,CAAC;QACJ,OAAM;IACV,CAAC;IAED,2BAA2B;IAC3B,qCAAqC;IAErC,IAAI,SAAS,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QACvB,GAAG,CAAC,+BAA+B,CAAC,CAAA;QACpC,OAAM;IACV,CAAC;IACD,KAAK,YAAY,CAAC,UAAU,CAAC,IAAI,EAAE,kBAAkB,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA,CAAC,yCAAyC;AAExH,CAAC","sourcesContent":["\r\nimport type { ReRunManager, RunType } from './reRunManager.js'\r\nimport type { RerunTestsFactory } from './listenToUser.js'\r\nimport { out } from '../../output.js'\r\n\r\n\r\nexport function handleUserInput(\r\n input: string,\r\n reRunManager: ReRunManager,\r\n rerunTestsCallback: RerunTestsFactory\r\n): void {\r\n const command = input.trim().toLowerCase()\r\n\r\n //console.log('command', command)\r\n\r\n //console.log('watchRunState.activeRuns', watchRunState.activeRuns)\r\n // if (rerunManager.watchRunState.activeRuns > 0) return\r\n\r\n let type: RunType\r\n let testFiles: Set<string>\r\n if (command === 'r' || command === 'l') {\r\n type = 'last'\r\n testFiles = reRunManager.state.lastTestFiles\r\n } else if (command === 'a') {\r\n type = 'all'\r\n testFiles = reRunManager.state.allTestFiles\r\n } else if (command === 'f') {\r\n type = 'failed'\r\n testFiles = reRunManager.state.failedTestFiles\r\n } else {\r\n return\r\n }\r\n\r\n //console.log('type', type)\r\n //console.log('testFiles', testFiles)\r\n\r\n if (testFiles.size === 0) {\r\n out('No suitable test files to run')\r\n return\r\n }\r\n void reRunManager.requestRun(type, rerunTestsCallback(new Set(testFiles))) /// CHECK is it appropriate to copy here?\r\n \r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injectProperties.js","sourceRoot":"","sources":["../../../src/cli/lib/injectProperties.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"injectProperties.js","sourceRoot":"","sources":["../../../src/cli/lib/injectProperties.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAG5D,MAAM,UAAU,gBAAgB,CAC5B,WAAoB,EAAE,gBAA6B,EAAE,IAAY,EAAE,SAAiB;IAEpF,MAAM,GAAG,GAAG,SAAS,IAAI,OAAO,CAAA;IAEhC,KAAK,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAC;QACjC,IAAI,kBAAkB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACnC,GAAG,CAAC,eAAe,GAAG,oDAAoD,IAAI,IAAI,CAAC,CAAA;QACvF,CAAC;IACL,CAAC;AACL,CAAC","sourcesContent":["\nimport type { OutFn, TaskExports } from '../../types.js'\nimport { out as mainOut } from '../../output.js'\nimport { reservedExportKeys } from './reservedExportKeys.js'\n\n\nexport function injectProperties(\n basePackage: unknown, injectProperties: TaskExports, from: string, customOut?: OutFn\n): void {\n const out = customOut ?? mainOut\n\n for (const key in injectProperties) {\n if (reservedExportKeys.includes(key)) {\n out(`Error: key '${key}' is reserved. Please do not use this key. From '${from}'.`)\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isTest.js","sourceRoot":"","sources":["../../../src/cli/lib/isTest.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"isTest.js","sourceRoot":"","sources":["../../../src/cli/lib/isTest.ts"],"names":[],"mappings":";AACA,yDAAyD","sourcesContent":["\r\n//export const isTest = (process.env.NODE_ENV === 'test')\r\n"]}
|