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 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');
package/deno.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "imports": {
3
+ "qunitx": "./shims/deno.js"
4
+ }
5
+ }