qunitx 0.6.1 → 0.8.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/README.md +5 -7
- package/build.js +54 -0
- package/deno.json +2 -2
- package/deno.lock +7 -3752
- package/package.json +21 -40
- package/{index.js → shims/browser/index.js} +2 -4
- package/shims/{deno-assert.js → deno/assert.js} +2 -2
- package/shims/{deno.js → deno/index.js} +1 -1
- package/shims/{nodejs-assert.js → node/assert.js} +1 -0
- package/shims/{nodejs.js → node/index.js} +2 -2
- package/vendor/package.json +1 -4
- package/cli.js +0 -24
- package/deno/cli.js +0 -21
- package/deno-bridge.js +0 -16
- package/lib/boilerplates/default-project-config-values.js +0 -6
- package/lib/boilerplates/setup/tests.hbs +0 -15
- package/lib/boilerplates/setup/tsconfig.json +0 -109
- package/lib/boilerplates/test.js +0 -25
- package/lib/commands/generate.js +0 -33
- package/lib/commands/help.js +0 -38
- package/lib/commands/init.js +0 -70
- package/lib/commands/run/tests-in-browser.js +0 -162
- package/lib/commands/run/tests-in-node.js +0 -60
- package/lib/commands/run.js +0 -159
- package/lib/servers/http.js +0 -233
- package/lib/setup/bind-server-to-port.js +0 -14
- package/lib/setup/browser.js +0 -55
- package/lib/setup/config.js +0 -46
- package/lib/setup/file-watcher.js +0 -72
- package/lib/setup/fs-tree.js +0 -48
- package/lib/setup/keyboard-events.js +0 -57
- package/lib/setup/node-js-environment.js +0 -74
- package/lib/setup/test-file-paths.js +0 -79
- package/lib/setup/web-server.js +0 -241
- package/lib/setup/write-output-static-files.js +0 -22
- package/lib/tap/display-final-result.js +0 -15
- package/lib/tap/display-test-result.js +0 -73
- package/lib/utils/find-internal-assets-from-html.js +0 -16
- package/lib/utils/find-project-root.js +0 -16
- package/lib/utils/indent-string.js +0 -11
- package/lib/utils/listen-to-keyboard-key.js +0 -42
- package/lib/utils/parse-cli-flags.js +0 -59
- package/lib/utils/path-exists.js +0 -11
- package/lib/utils/resolve-port-number-for.js +0 -27
- package/lib/utils/run-user-module.js +0 -18
- package/lib/utils/search-in-parent-directories.js +0 -15
- package/lib/utils/time-counter.js +0 -8
- package/test-output.log +0 -781
package/README.md
CHANGED
|
@@ -58,27 +58,25 @@ $ node --test some-test.js
|
|
|
58
58
|
|
|
59
59
|
# Suggested mode: if you want to run it in CI/google chrome:
|
|
60
60
|
|
|
61
|
-
$ qunitx some-test.js
|
|
61
|
+
$ qunitx some-test.js
|
|
62
62
|
|
|
63
63
|
# with browser output enabled:
|
|
64
64
|
|
|
65
|
-
$ qunitx some-test.js --
|
|
65
|
+
$ qunitx some-test.js --debug
|
|
66
66
|
|
|
67
67
|
# TypeScript also works, make sure on node.js mode, tsconfig.json exists with compilerOptions.module & compilerOptions.moduleResolution set to "NodeNext":
|
|
68
68
|
|
|
69
69
|
$ node --loader=ts-node/esm/transpile-only --test some-test.ts
|
|
70
70
|
|
|
71
|
-
$ qunitx some-test.ts --
|
|
71
|
+
$ qunitx some-test.ts --debug
|
|
72
72
|
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
### Code coverage
|
|
76
76
|
|
|
77
|
-
QUnitX
|
|
78
|
-
in existence at the moment:
|
|
79
|
-
|
|
77
|
+
Since QUnitX proxies to default node.js test runner in when executed with node, you can use any code coverage tool you like. When running the tests in `qunit`(the browser mode) code coverage support is limited.
|
|
80
78
|
```
|
|
81
|
-
c8
|
|
79
|
+
c8 node test/attachments test/user
|
|
82
80
|
```
|
|
83
81
|
|
|
84
82
|
You can browse [c8 documentation](https://github.com/bcoe/c8) for all configuration options.
|
package/build.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import fs from 'fs/promises';
|
|
2
|
+
|
|
3
|
+
let [qunitJS, qunitCSS, _] = await Promise.all([
|
|
4
|
+
fs.readFile('./node_modules/qunit/qunit/qunit.js'),
|
|
5
|
+
fs.readFile('./node_modules/qunit/qunit/qunit.css'),
|
|
6
|
+
fs.mkdir('./vendor', { recursive: true })
|
|
7
|
+
]);
|
|
8
|
+
|
|
9
|
+
let newQUnit = qunitJS.toString().replace(
|
|
10
|
+
'start: function start(count) {',
|
|
11
|
+
`reset: function() {
|
|
12
|
+
ProcessingQueue.finished = false;
|
|
13
|
+
globalStartCalled = false;
|
|
14
|
+
runStarted = false;
|
|
15
|
+
|
|
16
|
+
config.queue.length = 0;
|
|
17
|
+
config.modules.length = 0;
|
|
18
|
+
config.autostart = false;
|
|
19
|
+
|
|
20
|
+
Object.assign(config.stats, { total: 0, passed: 0, failed: 0, skipped: 0, todo: 0 });
|
|
21
|
+
|
|
22
|
+
[
|
|
23
|
+
"started", "updateRate", "filter", "depth", "current",
|
|
24
|
+
"pageLoaded", "timeoutHandler", "timeout", "pollution"
|
|
25
|
+
].forEach( ( key ) => delete config[ key ] );
|
|
26
|
+
|
|
27
|
+
const suiteReport = config.currentModule.suiteReport;
|
|
28
|
+
|
|
29
|
+
suiteReport.childSuites.length = 0;
|
|
30
|
+
delete suiteReport._startTime;
|
|
31
|
+
delete suiteReport._endTime;
|
|
32
|
+
|
|
33
|
+
config.modules.push( config.currentModule );
|
|
34
|
+
},
|
|
35
|
+
start: function start(count) {`);
|
|
36
|
+
|
|
37
|
+
await Promise.all([
|
|
38
|
+
fs.writeFile('./vendor/qunit.js', newQUnit),
|
|
39
|
+
fs.writeFile('./vendor/qunit.css', qunitCSS),
|
|
40
|
+
createPackageJSONIfNotExists()
|
|
41
|
+
]);
|
|
42
|
+
|
|
43
|
+
async function createPackageJSONIfNotExists() {
|
|
44
|
+
try {
|
|
45
|
+
await fs.stat('./vendor/package.json');
|
|
46
|
+
|
|
47
|
+
return true;
|
|
48
|
+
} catch (error) {
|
|
49
|
+
await fs.writeFile('./vendor/package.json', JSON.stringify({
|
|
50
|
+
name: 'qunitx-vendor',
|
|
51
|
+
version: '0.0.1'
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
}
|
package/deno.json
CHANGED