qunitx 1.3.0 → 1.3.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "qunitx",
3
3
  "type": "module",
4
- "version": "1.3.0",
4
+ "version": "1.3.2",
5
5
  "description": "Universal test library — run the same test file in Node.js, Deno, and the browser with QUnit's battle-tested assertion API",
6
6
  "author": "Izel Nakri",
7
7
  "license": "MIT",
@@ -109,12 +109,13 @@
109
109
  "lint:jsr": "deno publish --dry-run --allow-dirty"
110
110
  },
111
111
  "devDependencies": {
112
- "@types/node": "^26.2.0",
112
+ "@types/node": "^26.6.5",
113
113
  "esbuild": "0.28.2",
114
- "playwright-core": "^1.62.1",
115
- "prettier": "^3.9.6",
114
+ "jsdom": "^30.1.3",
115
+ "playwright-core": "^1.64.1",
116
+ "prettier": "^3.9.10",
116
117
  "qunit": "^2.26.0",
117
- "qunitx-cli": "^0.34.3",
118
+ "qunitx-cli": "^0.38.0",
118
119
  "typescript": "^7.0.2"
119
120
  },
120
121
  "volta": {
@@ -6,13 +6,16 @@
6
6
  *
7
7
  * @example
8
8
  * ```js
9
+ * // math_test.js
9
10
  * import { module, test } from "qunitx";
10
11
  *
11
12
  * module("Math", (hooks) => {
12
- * hooks.before((assert) => assert.step("setup"));
13
+ * hooks.beforeEach(function () {
14
+ * this.numbers = [1, 2, 3];
15
+ * });
13
16
  *
14
- * test("addition", (assert) => {
15
- * assert.equal(1 + 1, 2);
17
+ * test("addition", function (assert) {
18
+ * assert.equal(this.numbers.reduce((sum, n) => sum + n, 0), 6);
16
19
  * });
17
20
  *
18
21
  * test("async", async (assert) => {
@@ -22,6 +25,52 @@
22
25
  * });
23
26
  * ```
24
27
  *
28
+ * Both runtimes install it under the same name, so that one file runs on either.
29
+ * In a Deno project:
30
+ *
31
+ * ```sh
32
+ * deno add qunitx
33
+ * ```
34
+ *
35
+ * In a Node project:
36
+ *
37
+ * ```sh
38
+ * npm install --save-dev qunitx
39
+ * ```
40
+ *
41
+ * Then run it with whichever runner you have:
42
+ *
43
+ * ```sh
44
+ * deno test math_test.js
45
+ * node --test math_test.js
46
+ * ```
47
+ *
48
+ * @example
49
+ * ```js
50
+ * // The same test written with the BDD aliases — describe and it are the same
51
+ * // function objects as module and test, so everything above applies unchanged.
52
+ * import { describe, it } from "qunitx";
53
+ *
54
+ * describe("Math", (hooks) => {
55
+ * hooks.beforeEach(function () {
56
+ * this.numbers = [1, 2, 3];
57
+ * });
58
+ *
59
+ * it("addition", function (assert) {
60
+ * assert.equal(this.numbers.reduce((sum, n) => sum + n, 0), 6);
61
+ * });
62
+ *
63
+ * it("async", async (assert) => {
64
+ * const n = await Promise.resolve(42);
65
+ * assert.strictEqual(n, 42);
66
+ * });
67
+ * });
68
+ * ```
69
+ *
70
+ * `describe.skip`, `it.skip`, `it.todo`, runtime options, and nesting all behave
71
+ * identically to their `module` / `test` counterparts, and the commands above are
72
+ * unchanged.
73
+ *
25
74
  * @module
26
75
  */
27
76
  import '../../vendor/qunit.js';
package/vendor/qunit.js CHANGED
@@ -5723,6 +5723,7 @@
5723
5723
  }).then(unblockAndAdvanceQueue);
5724
5724
  }
5725
5725
  exportQUnit(QUnit);
5726
+ globalThis.QUnit = QUnit;
5726
5727
 
5727
5728
  (function () {
5728
5729
  if (!window$1 || !document) {