sxy-test-runner 2.2.1 → 2.2.3
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 +15 -4
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +8 -4
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/help.unitTest.js +5 -2
- package/dist/cli/help.unitTest.js.map +1 -1
- package/dist/cli/lib/findTestFiles.d.ts +1 -1
- package/dist/cli/lib/findTestFiles.d.ts.map +1 -1
- package/dist/cli/lib/findTestFiles.js +5 -2
- package/dist/cli/lib/findTestFiles.js.map +1 -1
- package/dist/cli/lib/findTestFiles.unitTest.js +5 -0
- package/dist/cli/lib/findTestFiles.unitTest.js.map +1 -1
- package/dist/cli/lib/listenToUser.d.ts +2 -1
- package/dist/cli/lib/listenToUser.d.ts.map +1 -1
- package/dist/cli/lib/listenToUser.js +23 -9
- package/dist/cli/lib/listenToUser.js.map +1 -1
- package/dist/cli/lib/listenToUser.unitTest.d.ts +2 -0
- package/dist/cli/lib/listenToUser.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/listenToUser.unitTest.js +37 -0
- package/dist/cli/lib/listenToUser.unitTest.js.map +1 -0
- package/dist/cli/lib/matchesTestFilesFilter.d.ts +3 -0
- package/dist/cli/lib/matchesTestFilesFilter.d.ts.map +1 -0
- package/dist/cli/lib/matchesTestFilesFilter.js +10 -0
- package/dist/cli/lib/matchesTestFilesFilter.js.map +1 -0
- package/dist/cli/lib/runTests.d.ts.map +1 -1
- package/dist/cli/lib/runTests.js +32 -7
- package/dist/cli/lib/runTests.js.map +1 -1
- package/dist/cli/lib/runTests.unitTest.js +55 -0
- package/dist/cli/lib/runTests.unitTest.js.map +1 -1
- package/dist/cli/lib/watchFilesAndRunTestsChokidar.d.ts +1 -1
- package/dist/cli/lib/watchFilesAndRunTestsChokidar.d.ts.map +1 -1
- package/dist/cli/lib/watchFilesAndRunTestsChokidar.js +4 -2
- package/dist/cli/lib/watchFilesAndRunTestsChokidar.js.map +1 -1
- package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.d.ts +1 -1
- package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.d.ts.map +1 -1
- package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.js +4 -2
- package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.js.map +1 -1
- package/dist/cli/lib/watchFilesChokidar.d.ts.map +1 -1
- package/dist/cli/lib/watchFilesChokidar.js +10 -0
- package/dist/cli/lib/watchFilesChokidar.js.map +1 -1
- package/dist/cli/lib/watchFilesChokidar.unitTest.js +41 -0
- package/dist/cli/lib/watchFilesChokidar.unitTest.js.map +1 -1
- package/dist/cli/lib/watchFilesNodeWatch.d.ts.map +1 -1
- package/dist/cli/lib/watchFilesNodeWatch.js +9 -4
- package/dist/cli/lib/watchFilesNodeWatch.js.map +1 -1
- package/dist/cli/lib/watchFilesNodeWatch.unitTest.js +42 -0
- package/dist/cli/lib/watchFilesNodeWatch.unitTest.js.map +1 -1
- package/dist/cli/once.d.ts.map +1 -1
- package/dist/cli/once.js +23 -2
- package/dist/cli/once.js.map +1 -1
- package/dist/cli/once.unitTest.js +33 -0
- package/dist/cli/once.unitTest.js.map +1 -1
- package/dist/cli/watch.d.ts.map +1 -1
- package/dist/cli/watch.js +23 -10
- package/dist/cli/watch.js.map +1 -1
- package/dist/cli/watch.unitTest.js +56 -65
- package/dist/cli/watch.unitTest.js.map +1 -1
- package/package.json +3 -2
- package/readme.md +20 -0
|
@@ -1,20 +1,39 @@
|
|
|
1
1
|
import figures from '../packages/figures.js';
|
|
2
2
|
import { watch } from './watch.js';
|
|
3
|
+
async function runWatchUntilOutput(commandLineArguments, expectedOutput, timeoutMs) {
|
|
4
|
+
const originalConsoleLog = console.log; // eslint-disable-line no-console
|
|
5
|
+
let consoleLogBuffer = '';
|
|
6
|
+
let resolveOutput = () => { };
|
|
7
|
+
let rejectOutput = () => { };
|
|
8
|
+
const outputSeen = new Promise((resolve, reject) => {
|
|
9
|
+
resolveOutput = resolve;
|
|
10
|
+
rejectOutput = reject;
|
|
11
|
+
});
|
|
12
|
+
const timeout = setTimeout(() => {
|
|
13
|
+
rejectOutput(new Error(`Timed out waiting for watch output: ${expectedOutput}\nCaptured output:\n${consoleLogBuffer}`));
|
|
14
|
+
}, timeoutMs);
|
|
15
|
+
console.log = function testLog(...texts) {
|
|
16
|
+
const line = texts.join(' ');
|
|
17
|
+
consoleLogBuffer += line + '\n';
|
|
18
|
+
if (line.includes(expectedOutput))
|
|
19
|
+
resolveOutput();
|
|
20
|
+
};
|
|
21
|
+
global.commandLineArguments = commandLineArguments;
|
|
22
|
+
const watchRun = watch();
|
|
23
|
+
void watchRun.catch(rejectOutput);
|
|
24
|
+
try {
|
|
25
|
+
await outputSeen;
|
|
26
|
+
}
|
|
27
|
+
finally {
|
|
28
|
+
clearTimeout(timeout);
|
|
29
|
+
console.log = originalConsoleLog; // eslint-disable-line no-console
|
|
30
|
+
}
|
|
31
|
+
return consoleLogBuffer;
|
|
32
|
+
}
|
|
3
33
|
mochaDescribe('watch command', function () {
|
|
4
34
|
mochaIt('should run tests and output results and display correct tallies', async function () {
|
|
5
|
-
this.timeout(
|
|
6
|
-
const
|
|
7
|
-
let consoleLogBuffer = '';
|
|
8
|
-
console.log = function testLog(...texts) {
|
|
9
|
-
consoleLogBuffer += texts.join(' ') + '\n';
|
|
10
|
-
};
|
|
11
|
-
global.commandLineArguments = [
|
|
12
|
-
'--config',
|
|
13
|
-
'unitTesting/watch/sxy-test-runner.config.js'
|
|
14
|
-
];
|
|
15
|
-
void watch();
|
|
16
|
-
await new Promise(resolve => setTimeout(resolve, 8000));
|
|
17
|
-
console.log = originalConsoleLog; // eslint-disable-line no-console
|
|
35
|
+
this.timeout(25000);
|
|
36
|
+
const consoleLogBuffer = await runWatchUntilOutput(['--config', 'unitTesting/watch/sxy-test-runner.config.js'], 'watching...', 20000);
|
|
18
37
|
const testFileName = 'unitTesting/watch/1.test.js';
|
|
19
38
|
const thing = 'Sample test 1';
|
|
20
39
|
const should = '1 should equal 1';
|
|
@@ -27,19 +46,8 @@ mochaDescribe('watch command', function () {
|
|
|
27
46
|
consoleLogBuffer.should.include('Test Files: 2/2');
|
|
28
47
|
});
|
|
29
48
|
mochaIt('should run tests and display correct tallies', async function () {
|
|
30
|
-
this.timeout(
|
|
31
|
-
const
|
|
32
|
-
let consoleLogBuffer = '';
|
|
33
|
-
console.log = function testLog(...texts) {
|
|
34
|
-
consoleLogBuffer += texts.join(' ') + '\n';
|
|
35
|
-
};
|
|
36
|
-
global.commandLineArguments = [
|
|
37
|
-
'--config',
|
|
38
|
-
'unitTesting/watch/sxy-test-runner.config.js'
|
|
39
|
-
];
|
|
40
|
-
void watch();
|
|
41
|
-
await new Promise(resolve => setTimeout(resolve, 8000));
|
|
42
|
-
console.log = originalConsoleLog; // eslint-disable-line no-console
|
|
49
|
+
this.timeout(25000);
|
|
50
|
+
const consoleLogBuffer = await runWatchUntilOutput(['--config', 'unitTesting/watch/sxy-test-runner.config.js'], 'watching...', 20000);
|
|
43
51
|
const testFileName = 'unitTesting/watch/1.test.js';
|
|
44
52
|
const thing = 'Sample test 1';
|
|
45
53
|
const should = '1 should equal 1';
|
|
@@ -48,57 +56,40 @@ mochaDescribe('watch command', function () {
|
|
|
48
56
|
consoleLogBuffer.should.include(should);
|
|
49
57
|
consoleLogBuffer.should.include(figures.tick);
|
|
50
58
|
});
|
|
51
|
-
mochaIt('
|
|
52
|
-
this.timeout(
|
|
53
|
-
const
|
|
54
|
-
let consoleLogBuffer = '';
|
|
55
|
-
console.log = function testLog(...texts) {
|
|
56
|
-
consoleLogBuffer += texts.join(' ') + '\n';
|
|
57
|
-
};
|
|
58
|
-
global.commandLineArguments = [
|
|
59
|
+
mochaIt('overrides and filters the configured test pattern', async function () {
|
|
60
|
+
this.timeout(25000);
|
|
61
|
+
const consoleLogBuffer = await runWatchUntilOutput([
|
|
59
62
|
'--config',
|
|
60
|
-
'sxy-test-runner.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
'unitTesting/watch/sxy-test-runner.config.js',
|
|
64
|
+
'--test-files',
|
|
65
|
+
'*.test.js',
|
|
66
|
+
'--filter',
|
|
67
|
+
'1.test.js'
|
|
68
|
+
], 'watching...', 20000);
|
|
69
|
+
consoleLogBuffer.should.include('Looking for tests using pattern: *.test.js');
|
|
70
|
+
consoleLogBuffer.should.include('Filtering tests using pattern: 1.test.js');
|
|
71
|
+
consoleLogBuffer.should.include('unitTesting/watch/1.test.js');
|
|
72
|
+
consoleLogBuffer.should.not.include('unitTesting/watch/2.test.js');
|
|
73
|
+
consoleLogBuffer.should.include('Test Files: 1/1');
|
|
74
|
+
});
|
|
75
|
+
mochaIt('should warn us when there are no tests', async function () {
|
|
76
|
+
this.timeout(15000);
|
|
77
|
+
const consoleLogBuffer = await runWatchUntilOutput(['--config', 'sxy-test-runner.no-tests.config.js'], 'watching...', 10000);
|
|
65
78
|
consoleLogBuffer.should.include('no tests found');
|
|
66
79
|
consoleLogBuffer.should.not.include('describing');
|
|
67
80
|
});
|
|
68
81
|
mochaIt('should not run tests when asked not to run initial tests', async function () {
|
|
69
|
-
this.timeout(
|
|
70
|
-
const
|
|
71
|
-
let consoleLogBuffer = '';
|
|
72
|
-
console.log = function testLog(...texts) {
|
|
73
|
-
consoleLogBuffer += texts.join(' ') + '\n';
|
|
74
|
-
};
|
|
75
|
-
global.commandLineArguments = [
|
|
76
|
-
'--config',
|
|
77
|
-
'sxy-test-runner.no-initial-tests.config.js'
|
|
78
|
-
];
|
|
79
|
-
void watch();
|
|
80
|
-
await new Promise(resolve => setTimeout(resolve, 4000));
|
|
81
|
-
console.log = originalConsoleLog; // eslint-disable-line no-console
|
|
82
|
+
this.timeout(15000);
|
|
83
|
+
const consoleLogBuffer = await runWatchUntilOutput(['--config', 'sxy-test-runner.no-initial-tests.config.js'], 'watching...', 10000);
|
|
82
84
|
consoleLogBuffer.should.not.include('running initial tests');
|
|
83
85
|
consoleLogBuffer.should.not.include('describing');
|
|
84
86
|
consoleLogBuffer.should.include('watching');
|
|
85
87
|
});
|
|
86
88
|
mochaIt('setup function and setup file from the config should have run', async function () {
|
|
87
|
-
this.timeout(
|
|
89
|
+
this.timeout(15000);
|
|
88
90
|
global.configBasedSetupFunctionRan = false;
|
|
89
91
|
global.watchSetupFileHasRun = false;
|
|
90
|
-
|
|
91
|
-
let consoleLogBuffer = '';
|
|
92
|
-
console.log = function testLog(...texts) {
|
|
93
|
-
consoleLogBuffer += texts.join(' ') + '\n';
|
|
94
|
-
};
|
|
95
|
-
global.commandLineArguments = [
|
|
96
|
-
'--config',
|
|
97
|
-
'sxy-test-runner.setup-tasks.config.js'
|
|
98
|
-
];
|
|
99
|
-
void watch();
|
|
100
|
-
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
101
|
-
console.log = originalConsoleLog; // eslint-disable-line no-console
|
|
92
|
+
await runWatchUntilOutput(['--config', 'sxy-test-runner.setup-tasks.config.js'], 'finding initial dependency trees...', 10000);
|
|
102
93
|
global.configBasedSetupFunctionRan.should.equal(true);
|
|
103
94
|
global.watchSetupFileHasRun.should.equal(true);
|
|
104
95
|
chaiExpect(process.env.SXYT).to.equal('true');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.unitTest.js","sourceRoot":"","sources":["../../src/cli/watch.unitTest.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,wBAAwB,CAAA;AAE5C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AASlC,
|
|
1
|
+
{"version":3,"file":"watch.unitTest.js","sourceRoot":"","sources":["../../src/cli/watch.unitTest.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,wBAAwB,CAAA;AAE5C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AASlC,KAAK,UAAU,mBAAmB,CAC9B,oBAA8B,EAC9B,cAAsB,EACtB,SAAiB;IAEjB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BAAmB,CAC9C,CAAC,UAAU,EAAE,4CAA4C,CAAC,EAC1D,aAAa,EACb,KAAK,CACR,CAAA;QAED,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAA;QAC5D,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,CAAA;QACjD,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;IAC/C,CAAC,CAAC,CAAA;IAEF,OAAO,CAAC,+DAA+D,EAAE,KAAK;QAC1E,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QAEnB,MAAM,CAAC,2BAA2B,GAAG,KAAK,CAAA;QAC1C,MAAM,CAAC,oBAAoB,GAAG,KAAK,CAAA;QAEnC,MAAM,mBAAmB,CACrB,CAAC,UAAU,EAAE,uCAAuC,CAAC,EACrD,qCAAqC,EACrC,KAAK,CACR,CAAA;QAED,MAAM,CAAC,2BAA2B,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QACrD,MAAM,CAAC,oBAAoB,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC9C,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAC7C,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAC5D,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sxy-test-runner",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://github.com/RobertSandiford/sxy-test-runner",
|
|
6
6
|
"repository": {
|
|
@@ -67,7 +67,8 @@
|
|
|
67
67
|
"scripts": {
|
|
68
68
|
"build": "rimraf dist && tsc --watch",
|
|
69
69
|
"build-once": "rimraf dist && tsc",
|
|
70
|
-
"dev": "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",
|
|
70
|
+
"dev": "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",
|
|
71
|
+
"dev-no-demon": "cross-env NODE_OPTIONS=\"--experimental-specifier-resolution=node\" node --experimental-specifier-resolution=node dist/cli/index.js",
|
|
71
72
|
"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",
|
|
72
73
|
"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",
|
|
73
74
|
"dev-coverage": "TODO",
|
package/readme.md
CHANGED
|
@@ -87,11 +87,31 @@ npx sxy-test-runner
|
|
|
87
87
|
|
|
88
88
|
sxy-test-runner runs watch mode, re-running only relevant tests, by default.
|
|
89
89
|
|
|
90
|
+
While watch mode is idle, enter `r` or `l` to re-run the last set of tests, `a` to run
|
|
91
|
+
all tests again, or `f` to re-run the currently failing tests.
|
|
92
|
+
|
|
90
93
|
To run tests only once and not watch (e.g. for ci/cd), use
|
|
91
94
|
```
|
|
92
95
|
npx sxy-test-runner once
|
|
93
96
|
```
|
|
94
97
|
|
|
98
|
+
To override the configured test pattern for either watch or once mode, use `-t` or
|
|
99
|
+
`--test-files`. The pattern remains relative to `testsBase`:
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
npx sxy-test-runner once --test-files "**/*.focused.test.js"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
To further constrain the configured test pattern without replacing it, use `-f` or
|
|
106
|
+
`--filter`. This pattern is also relative to `testsBase` and works in both modes:
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
npx sxy-test-runner once --filter "**/users/**"
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
`--test-files` and `--filter` can be combined: the former replaces the configured test
|
|
113
|
+
pattern, then the latter filters the discovered files.
|
|
114
|
+
|
|
95
115
|
To specific an alternate config, use -c or --config
|
|
96
116
|
```
|
|
97
117
|
npx sxy-test-runner --config sxy-test-runner.alternate.config.js
|