sxy-test-runner 2.4.3 → 2.4.4
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/AGENTS.md +55 -9
- package/dist/cli/help.js +6 -4
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/index.js +3 -23
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init.js +1 -0
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/lib/agentReport.d.ts +1 -1
- package/dist/cli/lib/agentReport.js +5 -0
- package/dist/cli/lib/agentReport.js.map +1 -1
- package/dist/cli/lib/defaultConfig.js +1 -0
- package/dist/cli/lib/defaultConfig.js.map +1 -1
- package/dist/cli/lib/parseCommandLineArguments.d.ts +1 -0
- package/dist/cli/lib/parseCommandLineArguments.js +15 -1
- package/dist/cli/lib/parseCommandLineArguments.js.map +1 -1
- package/dist/cli/lib/resolveCommand.d.ts +8 -0
- package/dist/cli/lib/resolveCommand.js +47 -0
- package/dist/cli/lib/resolveCommand.js.map +1 -0
- package/dist/cli/lib/runDescribe.d.ts +2 -1
- package/dist/cli/lib/runDescribe.js +5 -2
- package/dist/cli/lib/runDescribe.js.map +1 -1
- package/dist/cli/lib/runDescribeRun.d.ts +2 -1
- package/dist/cli/lib/runDescribeRun.js +8 -2
- package/dist/cli/lib/runDescribeRun.js.map +1 -1
- package/dist/cli/lib/runTest.d.ts +2 -1
- package/dist/cli/lib/runTest.js +6 -2
- package/dist/cli/lib/runTest.js.map +1 -1
- package/dist/cli/lib/runTests.js +19 -4
- package/dist/cli/lib/runTests.js.map +1 -1
- package/dist/cli/lib/stopSignal.d.ts +7 -0
- package/dist/cli/lib/stopSignal.js +10 -0
- package/dist/cli/lib/stopSignal.js.map +1 -0
- package/dist/cli/once.js +33 -11
- package/dist/cli/once.js.map +1 -1
- package/dist/cli/watch.js +3 -0
- package/dist/cli/watch.js.map +1 -1
- package/dist/types.d.ts +3 -2
- package/dist/types.js.map +1 -1
- package/package.json +3 -1
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,2EAA2E;AAC3E,2EAA2E;AAC3E,+EAA+E","sourcesContent":["// Shared types for the test-run data model, user config, and CLI plumbing.\n// The config/result shapes are inferred from usage across the old awaitful\n// source (defaultConfig.js, validateConfig.js, init.js's template, and the\n// run*/parseDescribe/showTestResult modules) - there was no prior type source.\n\nimport { DescribeMeta } from './describe.js'\nimport { FileMeta } from './meta.js'\n\nexport type ExecutionMode = 'parallel' | 'sequential'\nexport type GlobPattern = string | string[]\n\nexport interface ExecutionConfig {\n files: ExecutionMode\n describes: ExecutionMode\n tests: ExecutionMode\n}\n\n// path to write the latest watch run status to, or false to write none\nexport type StatusFileConfig = string | false\n\nexport interface WatchConfig {\n watchFilesBase: string\n watchFiles: GlobPattern\n watchFilesIgnore: GlobPattern\n runAllOnStartup: boolean\n reRunFailingTests: boolean\n // map a changed file to the tests that import it. Off, any watched change runs everything\n dependencyEvaluation: boolean\n ttyActionsOnKeypress: boolean\n statusFile: StatusFileConfig\n // report the session as single agent readable lines instead of the usual output\n agent: boolean\n}\n\nexport type TaskExports = Record<string, unknown>\nexport type ConfigTaskFn = (parcel?: TaskExports) => TaskExports | void | Promise<TaskExports | void>\n// a task may also be a file path (relative to the project root) to dynamically import\nexport type ConfigTask = ConfigTaskFn | string\nexport type ConfigTasks = ConfigTask | ConfigTask[]\n\nexport interface FinalConfig {\n testsBase: string\n tests: GlobPattern\n testsFilter?: string\n testsIgnore: GlobPattern\n setup?: ConfigTasks\n beforeEachFile?: ConfigTasks\n afterEachFile?: ConfigTasks\n beforeEachDescribe?: ConfigTasks\n afterEachDescribe?: ConfigTasks\n beforeEachTest?: ConfigTasks\n afterEachTest?: ConfigTasks\n teardown?: ConfigTasks\n showErrorTrace: boolean\n compact: boolean\n execution: ExecutionConfig\n watch: WatchConfig\n}\n\nexport type UserConfig = Partial
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,2EAA2E;AAC3E,2EAA2E;AAC3E,+EAA+E","sourcesContent":["// Shared types for the test-run data model, user config, and CLI plumbing.\n// The config/result shapes are inferred from usage across the old awaitful\n// source (defaultConfig.js, validateConfig.js, init.js's template, and the\n// run*/parseDescribe/showTestResult modules) - there was no prior type source.\n\nimport { DescribeMeta } from './describe.js'\nimport { FileMeta } from './meta.js'\n\nexport type ExecutionMode = 'parallel' | 'sequential'\nexport type GlobPattern = string | string[]\n\nexport interface ExecutionConfig {\n files: ExecutionMode\n describes: ExecutionMode\n tests: ExecutionMode\n}\n\n// path to write the latest watch run status to, or false to write none\nexport type StatusFileConfig = string | false\n\nexport interface WatchConfig {\n watchFilesBase: string\n watchFiles: GlobPattern\n watchFilesIgnore: GlobPattern\n runAllOnStartup: boolean\n reRunFailingTests: boolean\n // map a changed file to the tests that import it. Off, any watched change runs everything\n dependencyEvaluation: boolean\n ttyActionsOnKeypress: boolean\n statusFile: StatusFileConfig\n // report the session as single agent readable lines instead of the usual output\n agent: boolean\n}\n\nexport type TaskExports = Record<string, unknown>\nexport type ConfigTaskFn = (parcel?: TaskExports) => TaskExports | void | Promise<TaskExports | void>\n// a task may also be a file path (relative to the project root) to dynamically import\nexport type ConfigTask = ConfigTaskFn | string\nexport type ConfigTasks = ConfigTask | ConfigTask[]\n\nexport interface FinalConfig {\n testsBase: string\n tests: GlobPattern\n testsFilter?: string\n testsIgnore: GlobPattern\n setup?: ConfigTasks\n beforeEachFile?: ConfigTasks\n afterEachFile?: ConfigTasks\n beforeEachDescribe?: ConfigTasks\n afterEachDescribe?: ConfigTasks\n beforeEachTest?: ConfigTasks\n afterEachTest?: ConfigTasks\n teardown?: ConfigTasks\n showErrorTrace: boolean\n compact: boolean\n // stop the run at the first failing test, erroring describe or unloadable test file.\n // Set by `once --fail-fast` only: it describes one invocation, not a project, and in\n // watch mode it would silently truncate runs that report themselves as covering\n // everything\n failFast: boolean\n execution: ExecutionConfig\n watch: WatchConfig\n}\n\nexport type UserConfig = Partial<\n Omit<FinalConfig, 'testsFilter' | 'failFast' | 'execution' | 'watch'>\n> & {\n execution?: Partial<ExecutionConfig>\n watch?: Partial<WatchConfig>\n}\n\nexport type UserConfigInternal = UserConfig\n & Partial<Pick<FinalConfig, 'testsFilter' | 'failFast'>>\n\n\n// -- test-run data model --------------------------------------------------\n\nexport type TestParcel = TaskExports\n\nexport interface DescribeParcel extends TaskExports {\n it: (should: string, test: (parcel: TestParcel) => void | Promise<void>) => void\n test: (should: string, test: (parcel: TestParcel) => void | Promise<void>) => void\n afterDescribe: (func: () => void | Promise<void>) => void\n beforeEachTest: (func: () => TaskExports | void | Promise<TaskExports | void>) => void\n afterEachTest: (func: () => void | Promise<void>) => void\n}\n\nexport type DescribeCallback = (parcel: DescribeParcel) => void | Promise<void>\n\nexport interface Describe {\n counter: number\n thing: string\n meta?: DescribeMeta\n tests: DescribeCallback\n}\n\nexport interface It {\n counter: number\n should: string\n test: (parcel: TestParcel) => void | Promise<void>\n}\n\nexport interface ParsedDescribe {\n its: It[]\n beforeDescribeExports: TaskExports\n afterDescribeFunc?: () => void | Promise<void>\n beforeEachTestFunc?: () => TaskExports | void | Promise<TaskExports | void>\n afterEachTestFunc?: () => void | Promise<void>\n error?: unknown\n}\n\nexport interface TestError extends Error {\n actual?: unknown\n expected?: unknown\n}\n\nexport interface ItResult {\n counter: number\n should: string\n success: boolean | null\n time: number\n error?: TestError\n logs: unknown[][]\n}\n\nexport interface ItResultsSummary {\n total: number\n passes: number\n}\n\nexport interface DescribeResult {\n counter: number\n thing: string\n success: boolean | null\n // total elapsed for the whole describe, filled in by runDescribe once it has finished\n time: number\n itResults: ItResult[]\n itResultsSummary: ItResultsSummary\n logs?: unknown[][]\n error?: unknown\n}\n\nexport interface DescribeResultsSummary {\n total: number\n passes: number\n invalid: number\n itsTotal: number\n itsPasses: number\n}\n\nexport interface TestFile {\n file: string\n describes?: Describe[]\n meta?: FileMeta\n error?: string | false\n logs?: unknown[][]\n}\n\nexport interface TestResult {\n file: string\n success: boolean | null\n describeResults: DescribeResult[]\n describeResultsSummary: DescribeResultsSummary\n logs: unknown[][]\n}\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 DependencyTrees = Record<string, string[]>\n\nexport type OutFn = (...texts: unknown[]) => void\n\n\n\n// -- CLI argument parsing ---------------------------------------------------\n\nexport interface AllowedArgument {\n flag?: string\n hasValue: boolean\n}\n\nexport type AllowedArguments = Record<string, AllowedArgument>\nexport type AllowedFlags = Record<string, string>\nexport type ParsedArguments = Record<string, string | true>\n\nexport interface TestExecutionFilters {\n describe?: string\n it?: string\n}\n\n// -- globals ----------------------------------------------------------------\n\nexport interface SxyTestRunnerGlobal {\n describes: Describe[]\n describeCounter: number\n fileMeta?: FileMeta\n}\ndeclare global {\n // eslint-disable-next-line camelcase\n var __sxy_test_runner__: SxyTestRunnerGlobal | undefined\n // eslint-disable-next-line camelcase\n var __sxyt_commandLineArguments: string[]\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sxy-test-runner",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://github.com/RobertSandiford/sxy-test-runner",
|
|
6
6
|
"repository": {
|
|
@@ -77,8 +77,10 @@
|
|
|
77
77
|
"dev-mon": "cross-env NODE_OPTIONS=\"--experimental-specifier-resolution=node\" nodemon --experimental-specifier-resolution=node --watch dist/cli --watch dist/cli/lib --watch sxy-test-runner.config.js --watch sxy-loader.config.js dist/cli/index.js",
|
|
78
78
|
"dev-mon-input": "cross-env NODE_OPTIONS=\"--experimental-specifier-resolution=node\" nodemon --no-stdin --experimental-specifier-resolution=node --watch dist/cli --watch dist/cli/lib --watch sxy-test-runner.config.js --watch sxy-loader.config.js dist/cli/index.js",
|
|
79
79
|
"dev": "cross-env NODE_OPTIONS=\"--experimental-specifier-resolution=node\" node --experimental-specifier-resolution=node dist/cli/index.js",
|
|
80
|
+
"dev-agent": "cross-env NODE_OPTIONS=\"--experimental-specifier-resolution=node\" node --experimental-specifier-resolution=node dist/cli/index.js --agent",
|
|
80
81
|
"dev-seq-f": "cross-env NODE_OPTIONS=\"--experimental-specifier-resolution=node\" node --experimental-specifier-resolution=node dist/cli/index.js --config sxy-test-runner.seq-f.config.js",
|
|
81
82
|
"dev-once": "nodemon --experimental-specifier-resolution=node --watch dist/cli --watch sxy-test-runner.config.js --watch sxy-loader.config.js dist/cli/index.js once",
|
|
83
|
+
"dev-once-agent": "nodemon --experimental-specifier-resolution=node --watch dist/cli --watch sxy-test-runner.config.js --watch sxy-loader.config.js dist/cli/index.js once --agent",
|
|
82
84
|
"dev-help": "cross-env NODE_OPTIONS=\"--experimental-specifier-resolution=node\" nodemon --experimental-specifier-resolution=node --watch dist/cli --watch dist/cli/lib --watch sxy-test-runner.config.js --watch sxy-loader.config.js dist/cli/index.js help",
|
|
83
85
|
"dev-coverage": "TODO",
|
|
84
86
|
"start": "cross-env NODE_OPTIONS=\"--experimental-specifier-resolution=node\" node --experimental-specifier-resolution=node dist/cli/index.js",
|