qunitx-cli 0.5.6 → 0.5.7
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.
|
@@ -63,7 +63,7 @@ export default async function runTestsInBrowser(
|
|
|
63
63
|
|
|
64
64
|
// In group mode the COUNTER is shared across all groups and managed by run.js.
|
|
65
65
|
if (!config._groupMode) {
|
|
66
|
-
config.COUNTER = { testCount: 0, failCount: 0, skipCount: 0, passCount: 0 };
|
|
66
|
+
config.COUNTER = { testCount: 0, failCount: 0, skipCount: 0, passCount: 0, errorCount: 0 };
|
|
67
67
|
}
|
|
68
68
|
config.lastRanTestFiles = targetTestFilesToFilter || allTestFilePaths;
|
|
69
69
|
|
package/lib/commands/run.js
CHANGED
|
@@ -71,7 +71,7 @@ export default async function run(config) {
|
|
|
71
71
|
const groups = splitIntoGroups(allFiles, groupCount);
|
|
72
72
|
|
|
73
73
|
// Shared COUNTER so TAP test numbers are globally sequential across all groups.
|
|
74
|
-
config.COUNTER = { testCount: 0, failCount: 0, skipCount: 0, passCount: 0 };
|
|
74
|
+
config.COUNTER = { testCount: 0, failCount: 0, skipCount: 0, passCount: 0, errorCount: 0 };
|
|
75
75
|
config.lastRanTestFiles = allFiles;
|
|
76
76
|
|
|
77
77
|
const groupConfigs = groups.map((groupFiles, i) => ({
|
|
@@ -65,15 +65,19 @@ export default function setupFileWatchers(testFileLookupPaths, config, onEventFu
|
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Mutates `fsTree` in place based on a chokidar file-system event.
|
|
70
|
+
* @returns {void}
|
|
71
|
+
*/
|
|
72
|
+
export function mutateFSTree(fsTree, event, path) {
|
|
69
73
|
if (event === 'add') {
|
|
70
74
|
fsTree[path] = null;
|
|
71
75
|
} else if (event === 'unlink') {
|
|
72
76
|
delete fsTree[path];
|
|
73
77
|
} else if (event === 'unlinkDir') {
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
78
|
+
for (const treePath of Object.keys(fsTree)) {
|
|
79
|
+
if (treePath.startsWith(path)) delete fsTree[treePath];
|
|
80
|
+
}
|
|
77
81
|
}
|
|
78
82
|
}
|
|
79
83
|
|
|
@@ -26,7 +26,7 @@ export default function TAPDisplayTestResult(COUNTER, details) {
|
|
|
26
26
|
);
|
|
27
27
|
details.assertions.reduce((errorCount, assertion, index) => {
|
|
28
28
|
if (!assertion.passed && assertion.todo === false) {
|
|
29
|
-
COUNTER.errorCount
|
|
29
|
+
COUNTER.errorCount = (COUNTER.errorCount ?? 0) + 1;
|
|
30
30
|
const stack = assertion.stack?.match(/\(.+\)/g);
|
|
31
31
|
|
|
32
32
|
console.log(' ---');
|
|
@@ -13,7 +13,7 @@ export default function parseCliFlags(projectRoot) {
|
|
|
13
13
|
} else if (arg.startsWith('--failfast') || arg.startsWith('--failFast')) {
|
|
14
14
|
return Object.assign(result, { failFast: parseBoolean(arg.split('=')[1]) });
|
|
15
15
|
} else if (arg.startsWith('--timeout')) {
|
|
16
|
-
return Object.assign(result, { timeout: arg.split('=')[1] || 10000 });
|
|
16
|
+
return Object.assign(result, { timeout: Number(arg.split('=')[1]) || 10000 });
|
|
17
17
|
} else if (arg.startsWith('--output')) {
|
|
18
18
|
return Object.assign(result, { output: arg.split('=')[1] });
|
|
19
19
|
} else if (arg.endsWith('.html')) {
|
package/package.json
CHANGED
package/scripts/lint-docs.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// TODO: REMOVE THIS FILE once deno fixes the missing-return-type regression.
|
|
3
|
-
//
|
|
4
|
-
// WHY THIS FILE EXISTS:
|
|
5
|
-
// `deno doc --lint` has a regression in deno 2.7.x where JSDoc `@returns` tags
|
|
6
|
-
// are silently ignored for the `missing-return-type` check in JavaScript files.
|
|
7
|
-
// The check requires TypeScript-style return type annotations (`: ReturnType`)
|
|
8
|
-
// which are not valid syntax in `.js` files.
|
|
9
|
-
//
|
|
10
|
-
// All 22 `missing-return-type` errors are false positives caused by this bug.
|
|
11
|
-
// Every function has a correct `@returns` JSDoc tag — deno just doesn't read it.
|
|
12
|
-
//
|
|
13
|
-
// FIX OPTIONS (when ready):
|
|
14
|
-
// 1. Wait for deno to fix the regression (check deno changelog).
|
|
15
|
-
// 2. Convert lib/*.js files to lib/*.ts and add TS return type annotations.
|
|
16
|
-
//
|
|
17
|
-
// This script runs `deno doc --lint` and fails only on `missing-jsdoc` errors
|
|
18
|
-
// (i.e., the real quality check: "is every exported symbol documented?").
|
|
19
|
-
import { spawn } from 'node:child_process';
|
|
20
|
-
|
|
21
|
-
const proc = spawn('deno', ['doc', '--lint', 'lib/', 'cli.js'], { encoding: 'utf8' });
|
|
22
|
-
let output = '';
|
|
23
|
-
proc.stdout.on('data', (chunk) => (output += chunk));
|
|
24
|
-
proc.stderr.on('data', (chunk) => (output += chunk));
|
|
25
|
-
proc.on('close', () => {
|
|
26
|
-
// Strip ANSI escape codes so we can match on plain text
|
|
27
|
-
const plain = output.replace(/\x1b\[[0-9;]*m/g, '');
|
|
28
|
-
|
|
29
|
-
// Split into per-error blocks (each block starts with "error[")
|
|
30
|
-
const blocks = plain.split(/(?=^error\[)/m);
|
|
31
|
-
const relevant = blocks.filter((b) => !b.startsWith('error[missing-return-type]'));
|
|
32
|
-
const result = relevant.join('').trim();
|
|
33
|
-
|
|
34
|
-
if (result.includes('error[')) {
|
|
35
|
-
process.stderr.write(result + '\n');
|
|
36
|
-
process.exit(1);
|
|
37
|
-
} else if (result) {
|
|
38
|
-
process.stdout.write(result + '\n');
|
|
39
|
-
}
|
|
40
|
-
});
|