qunitx 1.1.4 → 1.1.5

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.
@@ -0,0 +1,156 @@
1
+ /**
2
+ * QUnitX — universal test library that runs the same test file in Node.js, Deno, and browser.
3
+ *
4
+ * Wraps QUnit's assertion API over each runtime's native BDD test runner so you only
5
+ * write your tests once.
6
+ *
7
+ * @example
8
+ * ```js
9
+ * import { module, test } from "qunitx";
10
+ *
11
+ * module("Math", (hooks) => {
12
+ * hooks.before((assert) => assert.step("setup"));
13
+ *
14
+ * test("addition", (assert) => {
15
+ * assert.equal(1 + 1, 2);
16
+ * });
17
+ *
18
+ * test("async", async (assert) => {
19
+ * const n = await Promise.resolve(42);
20
+ * assert.strictEqual(n, 42);
21
+ * });
22
+ * });
23
+ * ```
24
+ *
25
+ * @module
26
+ */
27
+ import { AssertionError as DenoAssertionError } from "jsr:@std/assert";
28
+ import type { AssertionErrorOptions } from "../types.d.ts";
29
+ import '../../vendor/qunit.js';
30
+ import Assert from '../shared/assert.d.ts';
31
+ import Module from './module.d.ts';
32
+ import Test from './test.d.ts';
33
+ /**
34
+ * Thrown when an assertion fails. Extends Deno's built-in `AssertionError`
35
+ * so it integrates cleanly with Deno's test runner output.
36
+ *
37
+ * You rarely construct this directly — assertion methods on {@linkcode Assert}
38
+ * throw it automatically on failure.
39
+ *
40
+ * @example
41
+ * ```js
42
+ * import { AssertionError } from "qunitx";
43
+ *
44
+ * try {
45
+ * throw new AssertionError({ message: "something went wrong" });
46
+ * } catch (e) {
47
+ * console.log(e instanceof AssertionError); // true
48
+ * }
49
+ * ```
50
+ */
51
+ export declare class AssertionError extends DenoAssertionError {
52
+ constructor(object: AssertionErrorOptions);
53
+ }
54
+ export { Assert };
55
+ /**
56
+ * Defines a test module (suite). Wraps Deno's `describe()` and sets up the
57
+ * QUnit lifecycle — `before`, `beforeEach`, `afterEach`, and `after` hooks,
58
+ * assertion counting, and step tracking.
59
+ *
60
+ * Each {@linkcode test} inside the callback receives an {@linkcode Assert} instance.
61
+ * Modules can be nested by calling `module()` inside another module's callback.
62
+ *
63
+ * @param {string} moduleName - Name of the test suite.
64
+ * @param {object} [runtimeOptions] - Optional Deno BDD options forwarded to `describe()`
65
+ * (e.g. `{ concurrency: false }`, `{ permissions: { read: true } }`).
66
+ * @param {function} moduleContent - Callback that defines tests and hooks.
67
+ * Receives `(hooks, { moduleName, options })` where `hooks` exposes
68
+ * `before`, `beforeEach`, `afterEach`, and `after`.
69
+ * @example
70
+ * ```js
71
+ * import { module, test } from "qunitx";
72
+ *
73
+ * module("Math", (hooks) => {
74
+ * hooks.before((assert) => {
75
+ * assert.step("before hook ran");
76
+ * });
77
+ *
78
+ * test("addition", (assert) => {
79
+ * assert.equal(2 + 2, 4);
80
+ * });
81
+ * });
82
+ * ```
83
+ * @example
84
+ * ```js
85
+ * // Nested modules
86
+ * module("Outer", () => {
87
+ * module("Inner", () => {
88
+ * test("nested test", (assert) => {
89
+ * assert.ok(true);
90
+ * });
91
+ * });
92
+ * });
93
+ * ```
94
+ */
95
+ export declare const module: typeof Module;
96
+ /**
97
+ * Defines an individual test. Wraps Deno's `it()` and handles the full QUnit
98
+ * lifecycle: `beforeEach`/`afterEach` hooks, async assertion waiting, and step
99
+ * verification. Must be called inside a {@linkcode module} callback.
100
+ *
101
+ * The test callback receives `(assert, { testName, options })` where `assert`
102
+ * is an {@linkcode Assert} instance.
103
+ *
104
+ * @param {string} testName - Name of the test.
105
+ * @param {object} [runtimeOptions] - Optional Deno BDD options forwarded to `it()`
106
+ * (e.g. `{ concurrency: false }`, `{ sanitizeExit: false }`).
107
+ * @param {function} testContent - Test callback receiving `(assert, { testName, options })`.
108
+ * @example
109
+ * ```js
110
+ * import { module, test } from "qunitx";
111
+ *
112
+ * module("Math", () => {
113
+ * test("addition", (assert) => {
114
+ * assert.equal(1 + 1, 2);
115
+ * });
116
+ *
117
+ * test("async resolves correctly", async (assert) => {
118
+ * const result = await Promise.resolve(42);
119
+ * assert.strictEqual(result, 42);
120
+ * });
121
+ * });
122
+ * ```
123
+ */
124
+ export declare const test: typeof Test;
125
+ /**
126
+ * The default export provides the full QUnitX API as a single object.
127
+ *
128
+ * @example
129
+ * ```js
130
+ * import qunitx from "qunitx";
131
+ *
132
+ * qunitx.module("Math", () => {
133
+ * qunitx.test("addition", (assert) => {
134
+ * assert.equal(1 + 1, 2);
135
+ * });
136
+ * });
137
+ * ```
138
+ *
139
+ * @property {Function} module - Defines a test suite. Wraps Deno's `describe()` with
140
+ * QUnit lifecycle hooks (`before`, `beforeEach`, `afterEach`, `after`).
141
+ * See the named {@linkcode module} export for full parameter documentation.
142
+ * @property {Function} test - Defines an individual test inside a `module()` callback.
143
+ * Receives an {@linkcode Assert} instance as its first argument.
144
+ * See the named {@linkcode test} export for full parameter documentation.
145
+ * @property {typeof AssertionError} AssertionError - The error class thrown when an
146
+ * assertion fails. Extends Deno's built-in `AssertionError`.
147
+ * @property {object} config - Runtime configuration object (currently unused; reserved
148
+ * for future QUnit config compatibility).
149
+ */
150
+ declare const _default: {
151
+ AssertionError: import("../types.d.ts").AssertionErrorConstructor;
152
+ module: typeof Module;
153
+ test: typeof Test;
154
+ config: {};
155
+ };
156
+ export default _default;
@@ -0,0 +1,161 @@
1
+ /**
2
+ * QUnitX — universal test library that runs the same test file in Node.js, Deno, and browser.
3
+ *
4
+ * Wraps QUnit's assertion API over each runtime's native BDD test runner so you only
5
+ * write your tests once.
6
+ *
7
+ * @example
8
+ * ```js
9
+ * import { module, test } from "qunitx";
10
+ *
11
+ * module("Math", (hooks) => {
12
+ * hooks.before((assert) => assert.step("setup"));
13
+ *
14
+ * test("addition", (assert) => {
15
+ * assert.equal(1 + 1, 2);
16
+ * });
17
+ *
18
+ * test("async", async (assert) => {
19
+ * const n = await Promise.resolve(42);
20
+ * assert.strictEqual(n, 42);
21
+ * });
22
+ * });
23
+ * ```
24
+ *
25
+ * @module
26
+ */
27
+ import { AssertionError as DenoAssertionError } from "jsr:@std/assert";
28
+ import '../../vendor/qunit.js';
29
+ import Assert from "../shared/assert.js";
30
+ import ModuleContext from "../shared/module-context.js";
31
+ import TestContext from "../shared/test-context.js";
32
+ import Module from "./module.js";
33
+ import Test from "./test.js";
34
+ /**
35
+ * Thrown when an assertion fails. Extends Deno's built-in `AssertionError`
36
+ * so it integrates cleanly with Deno's test runner output.
37
+ *
38
+ * You rarely construct this directly — assertion methods on {@linkcode Assert}
39
+ * throw it automatically on failure.
40
+ *
41
+ * @example
42
+ * ```js
43
+ * import { AssertionError } from "qunitx";
44
+ *
45
+ * try {
46
+ * throw new AssertionError({ message: "something went wrong" });
47
+ * } catch (e) {
48
+ * console.log(e instanceof AssertionError); // true
49
+ * }
50
+ * ```
51
+ */
52
+ export class AssertionError extends DenoAssertionError {
53
+ constructor(object) {
54
+ super(object.message ?? 'Assertion failed');
55
+ }
56
+ }
57
+ Assert.QUnit = globalThis.QUnit;
58
+ Assert.AssertionError = AssertionError;
59
+ Assert.inspect = Deno.inspect;
60
+ ModuleContext.Assert = Assert;
61
+ TestContext.Assert = Assert;
62
+ Object.freeze(Assert);
63
+ Object.freeze(ModuleContext);
64
+ Object.freeze(TestContext);
65
+ export { Assert };
66
+ /**
67
+ * Defines a test module (suite). Wraps Deno's `describe()` and sets up the
68
+ * QUnit lifecycle — `before`, `beforeEach`, `afterEach`, and `after` hooks,
69
+ * assertion counting, and step tracking.
70
+ *
71
+ * Each {@linkcode test} inside the callback receives an {@linkcode Assert} instance.
72
+ * Modules can be nested by calling `module()` inside another module's callback.
73
+ *
74
+ * @param {string} moduleName - Name of the test suite.
75
+ * @param {object} [runtimeOptions] - Optional Deno BDD options forwarded to `describe()`
76
+ * (e.g. `{ concurrency: false }`, `{ permissions: { read: true } }`).
77
+ * @param {function} moduleContent - Callback that defines tests and hooks.
78
+ * Receives `(hooks, { moduleName, options })` where `hooks` exposes
79
+ * `before`, `beforeEach`, `afterEach`, and `after`.
80
+ * @example
81
+ * ```js
82
+ * import { module, test } from "qunitx";
83
+ *
84
+ * module("Math", (hooks) => {
85
+ * hooks.before((assert) => {
86
+ * assert.step("before hook ran");
87
+ * });
88
+ *
89
+ * test("addition", (assert) => {
90
+ * assert.equal(2 + 2, 4);
91
+ * });
92
+ * });
93
+ * ```
94
+ * @example
95
+ * ```js
96
+ * // Nested modules
97
+ * module("Outer", () => {
98
+ * module("Inner", () => {
99
+ * test("nested test", (assert) => {
100
+ * assert.ok(true);
101
+ * });
102
+ * });
103
+ * });
104
+ * ```
105
+ */
106
+ export const module = Module;
107
+ /**
108
+ * Defines an individual test. Wraps Deno's `it()` and handles the full QUnit
109
+ * lifecycle: `beforeEach`/`afterEach` hooks, async assertion waiting, and step
110
+ * verification. Must be called inside a {@linkcode module} callback.
111
+ *
112
+ * The test callback receives `(assert, { testName, options })` where `assert`
113
+ * is an {@linkcode Assert} instance.
114
+ *
115
+ * @param {string} testName - Name of the test.
116
+ * @param {object} [runtimeOptions] - Optional Deno BDD options forwarded to `it()`
117
+ * (e.g. `{ concurrency: false }`, `{ sanitizeExit: false }`).
118
+ * @param {function} testContent - Test callback receiving `(assert, { testName, options })`.
119
+ * @example
120
+ * ```js
121
+ * import { module, test } from "qunitx";
122
+ *
123
+ * module("Math", () => {
124
+ * test("addition", (assert) => {
125
+ * assert.equal(1 + 1, 2);
126
+ * });
127
+ *
128
+ * test("async resolves correctly", async (assert) => {
129
+ * const result = await Promise.resolve(42);
130
+ * assert.strictEqual(result, 42);
131
+ * });
132
+ * });
133
+ * ```
134
+ */
135
+ export const test = Test;
136
+ /**
137
+ * The default export provides the full QUnitX API as a single object.
138
+ *
139
+ * @example
140
+ * ```js
141
+ * import qunitx from "qunitx";
142
+ *
143
+ * qunitx.module("Math", () => {
144
+ * qunitx.test("addition", (assert) => {
145
+ * assert.equal(1 + 1, 2);
146
+ * });
147
+ * });
148
+ * ```
149
+ *
150
+ * @property {Function} module - Defines a test suite. Wraps Deno's `describe()` with
151
+ * QUnit lifecycle hooks (`before`, `beforeEach`, `afterEach`, `after`).
152
+ * See the named {@linkcode module} export for full parameter documentation.
153
+ * @property {Function} test - Defines an individual test inside a `module()` callback.
154
+ * Receives an {@linkcode Assert} instance as its first argument.
155
+ * See the named {@linkcode test} export for full parameter documentation.
156
+ * @property {typeof AssertionError} AssertionError - The error class thrown when an
157
+ * assertion fails. Extends Deno's built-in `AssertionError`.
158
+ * @property {object} config - Runtime configuration object (currently unused; reserved
159
+ * for future QUnit config compatibility).
160
+ */
161
+ export default { AssertionError: Assert.AssertionError, module, test, config: {} };
@@ -0,0 +1,35 @@
1
+ import type Assert from '../shared/assert.d.ts';
2
+ import type { HooksObject } from '../types.d.ts';
3
+ export type { Assert };
4
+ export type { HookFn, HooksObject, PushResultInfo } from '../types.d.ts';
5
+ /**
6
+ * Defines a test module (suite) for Deno's BDD test runner.
7
+ *
8
+ * Wraps `describe()` from `@std/testing/bdd` and sets up the QUnit lifecycle
9
+ * (before/beforeEach/afterEach/after hooks, assertion counting, steps tracking).
10
+ *
11
+ * @param {string} moduleName - Name of the test suite
12
+ * @param {object} [runtimeOptions] - Optional Deno BDD options forwarded to `describe()`
13
+ * (e.g. `{ concurrency: false }`, `{ permissions: { read: true } }`)
14
+ * @param {function} moduleContent - Callback that defines tests and hooks via `hooks.before`,
15
+ * `hooks.beforeEach`, `hooks.afterEach`, `hooks.after`
16
+ * @returns {void}
17
+ * @example
18
+ * ```js ignore
19
+ * import { module, test } from "qunitx";
20
+ *
21
+ * module("Math", (hooks) => {
22
+ * hooks.before((assert) => {
23
+ * assert.step("before hook ran");
24
+ * });
25
+ *
26
+ * test("addition", (assert) => {
27
+ * assert.equal(2 + 2, 4);
28
+ * });
29
+ * });
30
+ * ```
31
+ */
32
+ export default function module(moduleName: string, runtimeOptions: object | ((hooks: HooksObject<Assert>) => void), moduleContent?: (hooks: HooksObject<Assert>, meta: {
33
+ moduleName: string;
34
+ options: unknown;
35
+ }) => void): void;
@@ -0,0 +1,76 @@
1
+ import { describe, beforeAll, afterAll } from "jsr:@std/testing/bdd";
2
+ import ModuleContext from "../shared/module-context.js";
3
+ /**
4
+ * Defines a test module (suite) for Deno's BDD test runner.
5
+ *
6
+ * Wraps `describe()` from `@std/testing/bdd` and sets up the QUnit lifecycle
7
+ * (before/beforeEach/afterEach/after hooks, assertion counting, steps tracking).
8
+ *
9
+ * @param {string} moduleName - Name of the test suite
10
+ * @param {object} [runtimeOptions] - Optional Deno BDD options forwarded to `describe()`
11
+ * (e.g. `{ concurrency: false }`, `{ permissions: { read: true } }`)
12
+ * @param {function} moduleContent - Callback that defines tests and hooks via `hooks.before`,
13
+ * `hooks.beforeEach`, `hooks.afterEach`, `hooks.after`
14
+ * @returns {void}
15
+ * @example
16
+ * ```js ignore
17
+ * import { module, test } from "qunitx";
18
+ *
19
+ * module("Math", (hooks) => {
20
+ * hooks.before((assert) => {
21
+ * assert.step("before hook ran");
22
+ * });
23
+ *
24
+ * test("addition", (assert) => {
25
+ * assert.equal(2 + 2, 4);
26
+ * });
27
+ * });
28
+ * ```
29
+ */
30
+ export default function module(moduleName, runtimeOptions, moduleContent) {
31
+ const targetRuntimeOptions = moduleContent ? runtimeOptions : {};
32
+ const targetModuleContent = (moduleContent ? moduleContent : runtimeOptions);
33
+ const moduleContext = new ModuleContext(moduleName);
34
+ describe(moduleName, { ...targetRuntimeOptions }, function () {
35
+ const beforeHooks = [];
36
+ const afterHooks = [];
37
+ beforeAll(async function () {
38
+ // before() assertions are attributed to the first direct test only (matching QUnit's model).
39
+ // Tests inherit parent context via prototype chain, so no Object.assign needed.
40
+ const firstTest = moduleContext.tests[0];
41
+ const beforeAssert = firstTest ? firstTest.assert : moduleContext.assert;
42
+ for (const hook of beforeHooks) {
43
+ await hook.call(moduleContext.userContext, beforeAssert);
44
+ }
45
+ });
46
+ afterAll(async () => {
47
+ for (const testContext of moduleContext.tests) {
48
+ await testContext.assert.waitForAsyncOps();
49
+ }
50
+ const lastTest = moduleContext.tests[moduleContext.tests.length - 1];
51
+ if (lastTest) {
52
+ for (let j = afterHooks.length - 1; j >= 0; j--) {
53
+ await afterHooks[j].call(lastTest.userContext, lastTest.assert);
54
+ }
55
+ }
56
+ for (let i = 0, len = moduleContext.tests.length; i < len; i++) {
57
+ moduleContext.tests[i].finish();
58
+ }
59
+ });
60
+ targetModuleContent.call(moduleContext.userContext, {
61
+ before(beforeFn) {
62
+ beforeHooks.push(beforeFn);
63
+ },
64
+ beforeEach(beforeEachFn) {
65
+ moduleContext.beforeEachHooks.push(beforeEachFn);
66
+ },
67
+ afterEach(afterEachFn) {
68
+ moduleContext.afterEachHooks.push(afterEachFn);
69
+ },
70
+ after(afterFn) {
71
+ afterHooks.push(afterFn);
72
+ }
73
+ }, { moduleName, options: runtimeOptions });
74
+ ModuleContext.currentModuleChain.pop();
75
+ });
76
+ }
@@ -0,0 +1,39 @@
1
+ import type Assert from '../shared/assert.d.ts';
2
+ export type { Assert };
3
+ export type { PushResultInfo } from '../types.d.ts';
4
+ /**
5
+ * Defines an individual test within a module for Deno's BDD test runner.
6
+ *
7
+ * Wraps `it()` from `@std/testing/bdd` and handles the full QUnit lifecycle:
8
+ * beforeEach/afterEach hooks, async assertion waiting, and step verification.
9
+ *
10
+ * Must be called inside a `module()` callback.
11
+ *
12
+ * @param {string} testName - Name of the test
13
+ * @param {object} [runtimeOptions] - Optional Deno BDD options forwarded to `it()`
14
+ * (e.g. `{ concurrency: false }`, `{ sanitizeExit: false }`)
15
+ * @param {function} testContent - Test callback receiving `(assert, { testName, options })`
16
+ * @returns {void}
17
+ * @example
18
+ * ```js ignore
19
+ * import { module, test } from "qunitx";
20
+ *
21
+ * module("Math", () => {
22
+ * test("addition", (assert) => {
23
+ * assert.equal(1 + 1, 2);
24
+ * });
25
+ *
26
+ * test("async resolves correctly", async (assert) => {
27
+ * const result = await Promise.resolve(42);
28
+ * assert.strictEqual(result, 42);
29
+ * });
30
+ * });
31
+ * ```
32
+ */
33
+ export default function test(testName: string, runtimeOptions: object | ((assert: Assert, meta: {
34
+ testName: string;
35
+ options: unknown;
36
+ }) => void | Promise<void>), testContent?: (assert: Assert, meta: {
37
+ testName: string;
38
+ options: unknown;
39
+ }) => void | Promise<void>): void;
@@ -0,0 +1,62 @@
1
+ import { it } from "jsr:@std/testing/bdd";
2
+ import TestContext from "../shared/test-context.js";
3
+ import ModuleContext from "../shared/module-context.js";
4
+ /**
5
+ * Defines an individual test within a module for Deno's BDD test runner.
6
+ *
7
+ * Wraps `it()` from `@std/testing/bdd` and handles the full QUnit lifecycle:
8
+ * beforeEach/afterEach hooks, async assertion waiting, and step verification.
9
+ *
10
+ * Must be called inside a `module()` callback.
11
+ *
12
+ * @param {string} testName - Name of the test
13
+ * @param {object} [runtimeOptions] - Optional Deno BDD options forwarded to `it()`
14
+ * (e.g. `{ concurrency: false }`, `{ sanitizeExit: false }`)
15
+ * @param {function} testContent - Test callback receiving `(assert, { testName, options })`
16
+ * @returns {void}
17
+ * @example
18
+ * ```js ignore
19
+ * import { module, test } from "qunitx";
20
+ *
21
+ * module("Math", () => {
22
+ * test("addition", (assert) => {
23
+ * assert.equal(1 + 1, 2);
24
+ * });
25
+ *
26
+ * test("async resolves correctly", async (assert) => {
27
+ * const result = await Promise.resolve(42);
28
+ * assert.strictEqual(result, 42);
29
+ * });
30
+ * });
31
+ * ```
32
+ */
33
+ export default function test(testName, runtimeOptions, testContent) {
34
+ const moduleContext = ModuleContext.lastModule;
35
+ if (!moduleContext) {
36
+ throw new Error(`Test '${testName}' called outside of module context.`);
37
+ }
38
+ const targetRuntimeOptions = testContent ? runtimeOptions : {};
39
+ const targetTestContent = (testContent ? testContent : runtimeOptions);
40
+ const context = new TestContext(testName, moduleContext);
41
+ // Each test gets a fresh plain object inheriting from the module's user context.
42
+ // This matches QUnit's prototype-chain model: before() sets props on the module context,
43
+ // tests inherit them, and each test's own writes don't pollute sibling tests.
44
+ const userContext = Object.create(moduleContext.userContext);
45
+ context.userContext = userContext;
46
+ it(testName, { ...targetRuntimeOptions }, async function () {
47
+ for (const module of context.module.moduleChain) {
48
+ for (const hook of module.beforeEachHooks) {
49
+ await hook.call(userContext, context.assert);
50
+ }
51
+ }
52
+ const result = await targetTestContent.call(userContext, context.assert, { testName, options: runtimeOptions });
53
+ await context.assert.waitForAsyncOps();
54
+ for (let i = context.module.moduleChain.length - 1; i >= 0; i--) {
55
+ const module = context.module.moduleChain[i];
56
+ for (let j = module.afterEachHooks.length - 1; j >= 0; j--) {
57
+ await module.afterEachHooks[j].call(userContext, context.assert);
58
+ }
59
+ }
60
+ return result;
61
+ });
62
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "qunitx",
3
3
  "type": "module",
4
- "version": "1.1.4",
4
+ "version": "1.1.5",
5
5
  "description": "A universal test framework for testing any js file on node.js, browser or deno with QUnit API",
6
6
  "author": "Izel Nakri",
7
7
  "license": "MIT",
@@ -49,7 +49,7 @@
49
49
  "imports": {
50
50
  "qunitx": {
51
51
  "types": "./dist/node/index.d.ts",
52
- "deno": "./shims/deno/index.ts",
52
+ "deno": "./dist/deno/index.js",
53
53
  "node": "./dist/node/index.js",
54
54
  "default": "./dist/browser/index.js"
55
55
  }
@@ -57,7 +57,7 @@
57
57
  "exports": {
58
58
  ".": {
59
59
  "types": "./dist/node/index.d.ts",
60
- "deno": "./shims/deno/index.ts",
60
+ "deno": "./dist/deno/index.js",
61
61
  "node": "./dist/node/index.js",
62
62
  "default": "./dist/browser/index.js"
63
63
  },
@@ -0,0 +1,8 @@
1
+ // Minimal Deno global declarations needed to compile shims/deno/ with tsc.
2
+ // The actual Deno runtime provides these at runtime.
3
+ declare namespace Deno {
4
+ function inspect(
5
+ value: unknown,
6
+ options?: { depth?: number; colors?: boolean; compact?: number | boolean },
7
+ ): string;
8
+ }
@@ -0,0 +1,7 @@
1
+ // Type stub for jsr:@std/assert. Deno resolves the real module at runtime.
2
+ declare module 'jsr:@std/assert' {
3
+ class AssertionError extends Error {
4
+ constructor(message?: string);
5
+ }
6
+ export { AssertionError };
7
+ }
@@ -0,0 +1,9 @@
1
+ // Type stub for jsr:@std/testing/bdd. Deno resolves the real module at runtime.
2
+ declare module 'jsr:@std/testing/bdd' {
3
+ function describe(name: string, fn: () => void): void;
4
+ function describe(name: string, options: object, fn: () => void): void;
5
+ function it(name: string, options: object, fn: () => void | Promise<void>): void;
6
+ function beforeAll(fn: () => void | Promise<void>): void;
7
+ function afterAll(fn: () => void | Promise<void>): void;
8
+ export { describe, it, beforeAll, afterAll };
9
+ }