sxy-test-runner 2.2.6 → 2.2.8
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
CHANGED
|
@@ -96,6 +96,13 @@ configured pattern. Both options are resolved relative to `testsBase` and can be
|
|
|
96
96
|
and test names. They work in both watch and `once` modes and can be combined. If the
|
|
97
97
|
filters select no runnable tests, `once` exits with code `4`.
|
|
98
98
|
|
|
99
|
+
Describe and test filters run after the selected test files have loaded. The runner gives
|
|
100
|
+
each test file a fresh ESM instance and propagates it through the file's static dependency
|
|
101
|
+
graph, bypassing the ordinary ESM cache. Loading many files and filtering their registered
|
|
102
|
+
describes or tests afterward can therefore be much slower than file filtering. Prefer
|
|
103
|
+
`--filter` when a file glob can narrow the run, then use `--filter-describe` or
|
|
104
|
+
`--filter-it` only for further narrowing inside those files.
|
|
105
|
+
|
|
99
106
|
Test discovery uses Node's built-in glob implementation. Patterns are resolved relative to
|
|
100
107
|
`testsBase`, and ignore patterns are resolved from that same base.
|
|
101
108
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseCommandLineArguments.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/parseCommandLineArguments.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parseCommandLineArguments.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/parseCommandLineArguments.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAmB,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAIxF,wBAAgB,yBAAyB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,eAAe,CA8D7F"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// watch:
|
|
2
2
|
// once:
|
|
3
3
|
// // --config configLocation
|
|
4
|
+
import { reduce as objectReduce } from 'sxy-lib/objects.js';
|
|
4
5
|
import { packageName } from '../../config.js';
|
|
5
6
|
import { log } from '../../output.js';
|
|
6
7
|
import { getAllowedFlags } from './getAllowedFlags.js';
|
|
@@ -25,7 +26,15 @@ export function parseCommandLineArguments(allowedArguments) {
|
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
else {
|
|
28
|
-
log(`[${packageName}] Unknown option
|
|
29
|
+
log(`[${packageName}] Unknown option --${longFlag}`);
|
|
30
|
+
if (longFlag.length === 1
|
|
31
|
+
&& objectReduce(allowedArguments, (prev, _key, value) => {
|
|
32
|
+
if (value.flag === longFlag)
|
|
33
|
+
return true;
|
|
34
|
+
return prev;
|
|
35
|
+
}, false)) {
|
|
36
|
+
log('I think you meant -${longFlag}');
|
|
37
|
+
}
|
|
29
38
|
}
|
|
30
39
|
}
|
|
31
40
|
else if (arg.slice(0, 1) === '-') {
|
|
@@ -33,7 +42,7 @@ export function parseCommandLineArguments(allowedArguments) {
|
|
|
33
42
|
const longFlag = allowedFlags[shortFlag];
|
|
34
43
|
if (longFlag !== undefined) {
|
|
35
44
|
if (longFlag in returnArgs) {
|
|
36
|
-
log(`[${packageName}] Option
|
|
45
|
+
log(`[${packageName}] Option --${longFlag} already set, being overwritten by -${shortFlag}`);
|
|
37
46
|
}
|
|
38
47
|
const allowedArgument = allowedArguments[longFlag];
|
|
39
48
|
if (allowedArgument?.hasValue === true) {
|
|
@@ -46,7 +55,10 @@ export function parseCommandLineArguments(allowedArguments) {
|
|
|
46
55
|
}
|
|
47
56
|
}
|
|
48
57
|
else {
|
|
49
|
-
log(`[${packageName}] Unknown flag
|
|
58
|
+
log(`[${packageName}] Unknown flag -${shortFlag}`);
|
|
59
|
+
if (shortFlag.length > 1 && shortFlag in allowedArguments) {
|
|
60
|
+
log('I think you meant -${longFlag}');
|
|
61
|
+
}
|
|
50
62
|
}
|
|
51
63
|
}
|
|
52
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseCommandLineArguments.js","sourceRoot":"","sources":["../../../src/cli/lib/parseCommandLineArguments.ts"],"names":[],"mappings":"AAAA,SAAS;A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I,WAAW,mBAAmB,SAAS,EAAE,CAAC,CAAA;gBAClD,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,SAAS,IAAI,gBAAgB,EAAE,CAAC;oBACxD,GAAG,CAAC,gCAAgC,CAAC,CAAA;gBACzC,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,UAAU,CAAA;AACrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sxy-test-runner",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://github.com/RobertSandiford/sxy-test-runner",
|
|
6
6
|
"repository": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"chalk": "^4.1.2",
|
|
39
39
|
"chokidar": "^3.6.0",
|
|
40
40
|
"cross-env": "^7.0.3",
|
|
41
|
-
"dependency-tree": "^
|
|
41
|
+
"dependency-tree": "^12.0.1",
|
|
42
42
|
"esm-reload": "^1.0.1",
|
|
43
43
|
"minimatch": "^5.1.9",
|
|
44
44
|
"node-watch": "^0.7.4",
|
package/readme.md
CHANGED
|
@@ -115,6 +115,13 @@ npx sxy-test-runner once --filter "**/users/**"
|
|
|
115
115
|
`--test-files` and `--filter` can be combined: the former replaces the configured test
|
|
116
116
|
pattern, then the latter filters the discovered files.
|
|
117
117
|
|
|
118
|
+
`--filter-describe` and `--filter-it` filter by name, but only after the selected test files
|
|
119
|
+
have loaded. sxy-test-runner gives each test file a fresh ESM instance and propagates it
|
|
120
|
+
through that file's static dependency graph, bypassing the ordinary ESM cache. Loading a
|
|
121
|
+
large set of files and filtering their describes or tests afterward can therefore be much
|
|
122
|
+
slower than filtering files first. Prefer `--filter` when a file glob can select the work
|
|
123
|
+
you need, and use the name filters for further narrowing within those files.
|
|
124
|
+
|
|
118
125
|
To specific an alternate config, use -c or --config
|
|
119
126
|
```
|
|
120
127
|
npx sxy-test-runner --config sxy-test-runner.alternate.config.js
|