qunitx 0.4.5 → 0.5.1
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 +8 -1
- package/deno/cli.js +21 -0
- package/deno-bridge.js +16 -0
- package/deno.json +5 -0
- package/deno.lock +3513 -0
- package/lib/boilerplates/test.js +1 -1
- package/lib/boilerplates/tsconfig.json +109 -0
- package/lib/commands/generate.js +3 -3
- package/lib/commands/help.js +3 -3
- package/lib/commands/init.js +14 -4
- package/lib/commands/run/tests-in-browser.js +3 -3
- package/lib/commands/run.js +5 -6
- package/lib/setup/browser.js +3 -2
- package/lib/setup/config.js +1 -1
- package/lib/setup/fs-tree.js +1 -2
- package/lib/setup/web-server.js +5 -6
- package/lib/setup/write-output-static-files.js +1 -1
- package/lib/utils/listen-to-keyboard-key.js +0 -1
- package/lib/utils/parse-cli-flags.js +1 -1
- package/lib/utils/path-exists.js +1 -1
- package/package.json +19 -4
- package/shims/deno-assert.js +55 -0
- package/shims/deno.js +46 -0
- package/shims/nodejs-assert.js +10 -3
- package/shims/nodejs.js +2 -0
- package/test-output.log +958 -818
- package/cool.txt +0 -0
- package/lol.js +0 -4
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ import { module, test } from 'qunitx';
|
|
|
32
32
|
Example:
|
|
33
33
|
|
|
34
34
|
```js
|
|
35
|
-
// in some-test.js: (typescript is also supported for --browser mode)
|
|
35
|
+
// in some-test.js: (typescript is also supported for --browser mode and node.js with --loader flag)
|
|
36
36
|
import { module, test } from 'qunitx';
|
|
37
37
|
import $ from 'jquery';
|
|
38
38
|
|
|
@@ -63,6 +63,13 @@ $ qunitx some-test.js --browser
|
|
|
63
63
|
# with browser output enabled:
|
|
64
64
|
|
|
65
65
|
$ qunitx some-test.js --browser --debug
|
|
66
|
+
|
|
67
|
+
# TypeScript also works, make sure on node.js mode, tsconfig.json exists with compilerOptions.module & compilerOptions.moduleResolution set to "NodeNext":
|
|
68
|
+
|
|
69
|
+
$ node --loader=ts-node/esm/transpile-only --test some-test.ts
|
|
70
|
+
|
|
71
|
+
$ qunitx some-test.ts --browser --debug
|
|
72
|
+
|
|
66
73
|
```
|
|
67
74
|
|
|
68
75
|
### Code coverage
|
package/deno/cli.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import process from "node:process";
|
|
2
|
+
import displayHelpOutput from '../lib/commands/help.js';
|
|
3
|
+
|
|
4
|
+
process.title = 'qunitx';
|
|
5
|
+
|
|
6
|
+
(async () => {
|
|
7
|
+
if (!process.argv[2]) {
|
|
8
|
+
return await displayHelpOutput();
|
|
9
|
+
} else if (['help', 'h', 'p', 'print'].includes(process.argv[2])) {
|
|
10
|
+
return await displayHelpOutput();
|
|
11
|
+
}
|
|
12
|
+
// else if (['new', 'n', 'g', 'generate'].includes(process.argv[2])) {
|
|
13
|
+
// return await generateTestFiles();
|
|
14
|
+
// } else if (['init'].includes(process.argv[2])) {
|
|
15
|
+
// return await initializeProject();
|
|
16
|
+
// }
|
|
17
|
+
|
|
18
|
+
// let config = await setupConfig();
|
|
19
|
+
|
|
20
|
+
// return await run(config);
|
|
21
|
+
})();
|
package/deno-bridge.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// This tool turns package.json imports into deno.json. Also binary make const mappings(without npm:) npm packages to asset-map.json?
|
|
2
|
+
import fs from 'fs/promises';
|
|
3
|
+
|
|
4
|
+
const packageJSON = JSON.parse(await fs.readFile('./package.json', 'utf8'));
|
|
5
|
+
|
|
6
|
+
packageJSON.imports = packageJSON.imports || {};
|
|
7
|
+
|
|
8
|
+
const assetMapContents = Object.keys(packageJSON.imports).reduce((result, dependencyName) => {
|
|
9
|
+
Object.assign(result.imports, {
|
|
10
|
+
[dependencyName]: packageJSON.imports[dependencyName]['deno'] || packageJSON.imports[dependencyName]['default'] || packageJSON.imports[dependencyName]['browser']
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
return result;
|
|
14
|
+
}, { imports: {} });
|
|
15
|
+
|
|
16
|
+
await fs.writeFile('./deno.json', JSON.stringify(assetMapContents, null, 2), 'utf8');
|