@reporters/testwatch 1.5.0 → 2.0.0
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/index.js +9 -11
- package/nodeVersion.js +4 -7
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const { pipeline } = require('node:stream/promises');
|
|
7
|
-
const {
|
|
3
|
+
import { run } from 'node:test';
|
|
4
|
+
import { pipeline } from 'node:stream/promises';
|
|
5
|
+
import {
|
|
8
6
|
on, once, EventEmitter, setMaxListeners,
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
} from 'node:events';
|
|
8
|
+
import { glob } from 'glob';
|
|
9
|
+
import chalk from 'chalk';
|
|
10
|
+
|
|
11
|
+
import { spec as SpecReporter } from 'node:test/reporters';
|
|
12
|
+
import { isSupported } from './nodeVersion.js';
|
|
13
13
|
|
|
14
14
|
if (!isSupported) {
|
|
15
15
|
/* c8 ignore next 3 */
|
|
16
16
|
console.log(chalk.magenta('Node.js <= 20.3.0 is not supported.'));
|
|
17
17
|
process.exit(0);
|
|
18
18
|
}
|
|
19
|
-
// eslint-disable-next-line import/no-unresolved, import/order
|
|
20
|
-
const { spec: SpecReporter } = require('node:test/reporters');
|
|
21
19
|
|
|
22
20
|
const KEYS = {
|
|
23
21
|
CTRLC: '\x03',
|
package/nodeVersion.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
const [major, minor] = process.versions.node.split('.').map(Number);
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
minor
|
|
8
|
-
|
|
9
|
-
};
|
|
3
|
+
export { major, minor };
|
|
4
|
+
export const isSupported = major > 20
|
|
5
|
+
|| (major === 20 && minor >= 3)
|
|
6
|
+
|| (major === 18 && minor >= 17);
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reporters/testwatch",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "An interactive repl for `node:test`",
|
|
5
|
-
"type": "
|
|
5
|
+
"type": "module",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"node:test",
|
|
8
8
|
"test",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"nodeVersion.js"
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
18
|
-
"test": "node --test-reporter=../
|
|
18
|
+
"test": "node --test-reporter=../gh/index.js --test tests/index.test.js",
|
|
19
19
|
"test:watch": "testwatch tests/index"
|
|
20
20
|
},
|
|
21
21
|
"bugs": {
|