qunitx 0.7.0 → 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.
Files changed (43) hide show
  1. package/build.js +54 -0
  2. package/deno.json +2 -2
  3. package/deno.lock +0 -3752
  4. package/package.json +20 -40
  5. package/{index.js → shims/browser/index.js} +2 -4
  6. package/shims/{deno.js → deno/index.js} +1 -1
  7. package/shims/{nodejs.js → node/index.js} +1 -1
  8. package/vendor/package.json +1 -4
  9. package/cli.js +0 -25
  10. package/deno/cli.js +0 -21
  11. package/lib/boilerplates/default-project-config-values.js +0 -6
  12. package/lib/boilerplates/setup/tests.hbs +0 -15
  13. package/lib/boilerplates/setup/tsconfig.json +0 -109
  14. package/lib/boilerplates/test.js +0 -25
  15. package/lib/commands/generate.js +0 -33
  16. package/lib/commands/help.js +0 -38
  17. package/lib/commands/init.js +0 -70
  18. package/lib/commands/run/tests-in-browser.js +0 -162
  19. package/lib/commands/run.js +0 -119
  20. package/lib/servers/http.js +0 -233
  21. package/lib/setup/bind-server-to-port.js +0 -14
  22. package/lib/setup/browser.js +0 -55
  23. package/lib/setup/config.js +0 -46
  24. package/lib/setup/file-watcher.js +0 -72
  25. package/lib/setup/fs-tree.js +0 -48
  26. package/lib/setup/keyboard-events.js +0 -34
  27. package/lib/setup/test-file-paths.js +0 -79
  28. package/lib/setup/web-server.js +0 -241
  29. package/lib/setup/write-output-static-files.js +0 -22
  30. package/lib/tap/display-final-result.js +0 -15
  31. package/lib/tap/display-test-result.js +0 -73
  32. package/lib/utils/find-internal-assets-from-html.js +0 -16
  33. package/lib/utils/find-project-root.js +0 -17
  34. package/lib/utils/indent-string.js +0 -11
  35. package/lib/utils/listen-to-keyboard-key.js +0 -44
  36. package/lib/utils/parse-cli-flags.js +0 -57
  37. package/lib/utils/path-exists.js +0 -11
  38. package/lib/utils/resolve-port-number-for.js +0 -27
  39. package/lib/utils/run-user-module.js +0 -18
  40. package/lib/utils/search-in-parent-directories.js +0 -15
  41. package/lib/utils/time-counter.js +0 -8
  42. /package/shims/{deno-assert.js → deno/assert.js} +0 -0
  43. /package/shims/{nodejs-assert.js → node/assert.js} +0 -0
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
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "imports": {
3
- "qunitx": "./shims/deno.js"
3
+ "qunitx": "./shims/deno/index.js"
4
4
  }
5
- }
5
+ }