function module

Additional properties on the module function.

Functions

f
module.skipModule(
moduleName: string,
_moduleContent?: unknown
): void

Skips all tests inside a module. Equivalent to QUnit.module.skip. The module is registered as ignored by Deno's runner; no test bodies run.

f
module.todoModule(
moduleName: string,
_moduleContent?: unknown
): void

Marks all tests inside a module as todo. Equivalent to QUnit.module.todo. The module is registered as ignored by Deno's runner; no test bodies run. Deno has no native "todo module" concept, so this maps to ignore.

Additional properties on the module function.

Functions

f
module.skipModule(
moduleName: string,
_moduleContent?: unknown
): void

Skips all tests inside a module. Equivalent to QUnit.module.skip. The module is registered as ignored by Deno's runner; no test bodies run.

f
module.todoModule(
moduleName: string,
_moduleContent?: unknown
): void

Marks all tests inside a module as todo. Equivalent to QUnit.module.todo. The module is registered as ignored by Deno's runner; no test bodies run. Deno has no native "todo module" concept, so this maps to ignore.

Additional properties on the module function.

Functions

f
module.skipModule(
moduleName: string,
_moduleContent?: unknown
): void

Skips all tests inside a module. Equivalent to QUnit.module.skip. The module is registered as ignored by Deno's runner; no test bodies run.

f
module.todoModule(
moduleName: string,
_moduleContent?: unknown
): void

Marks all tests inside a module as todo. Equivalent to QUnit.module.todo. The module is registered as ignored by Deno's runner; no test bodies run. Deno has no native "todo module" concept, so this maps to ignore.

module(
moduleName: string,
moduleContent: (
hooks: HooksObject<Assert>,
meta: { moduleName: string; options: unknown; context: Record<string, unknown>; }
) => void
): void

Defines a test module (suite) for Deno's BDD test runner.

Wraps describe() from @std/testing/bdd and sets up the QUnit lifecycle (before/beforeEach/afterEach/after hooks, assertion counting, steps tracking).

Examples

Example 1

import { module, test } from "qunitx";

module("Math", (hooks) => {
  hooks.before((assert) => {
    assert.step("before hook ran");
  });

  test("addition", (assert) => {
    assert.equal(2 + 2, 4);
  });
});

Parameters

moduleName: string

Name of the test suite

moduleContent: (
hooks: HooksObject<Assert>,
meta: { moduleName: string; options: unknown; context: Record<string, unknown>; }
) => void

Callback that defines tests and hooks via hooks.before, hooks.beforeEach, hooks.afterEach, hooks.after

Return Type

void
module(
moduleName: string,
runtimeOptions: object,
moduleContent: (
hooks: HooksObject<Assert>,
meta: { moduleName: string; options: unknown; context: Record<string, unknown>; }
) => void
): void

Defines a test module (suite) with optional Deno BDD runtime options forwarded to describe().

Parameters

moduleName: string
runtimeOptions: object
moduleContent: (
hooks: HooksObject<Assert>,
meta: { moduleName: string; options: unknown; context: Record<string, unknown>; }
) => void

Return Type

void
namespace module

Additional properties on the module function.

Functions

f
module.skipModule(
moduleName: string,
_moduleContent?: unknown
): void

Skips all tests inside a module. Equivalent to QUnit.module.skip. The module is registered as ignored by Deno's runner; no test bodies run.

f
module.todoModule(
moduleName: string,
_moduleContent?: unknown
): void

Marks all tests inside a module as todo. Equivalent to QUnit.module.todo. The module is registered as ignored by Deno's runner; no test bodies run. Deno has no native "todo module" concept, so this maps to ignore.

Additional properties on the module function.

Functions

f
module.skipModule(
moduleName: string,
_moduleContent?: unknown
): void

Skips all tests inside a module. Equivalent to QUnit.module.skip. The module is registered as ignored by Deno's runner; no test bodies run.

f
module.todoModule(
moduleName: string,
_moduleContent?: unknown
): void

Marks all tests inside a module as todo. Equivalent to QUnit.module.todo. The module is registered as ignored by Deno's runner; no test bodies run. Deno has no native "todo module" concept, so this maps to ignore.

Additional properties on the module function.

Functions

f
module.skipModule(
moduleName: string,
_moduleContent?: unknown
): void

Skips all tests inside a module. Equivalent to QUnit.module.skip. The module is registered as ignored by Deno's runner; no test bodies run.

f
module.todoModule(
moduleName: string,
_moduleContent?: unknown
): void

Marks all tests inside a module as todo. Equivalent to QUnit.module.todo. The module is registered as ignored by Deno's runner; no test bodies run. Deno has no native "todo module" concept, so this maps to ignore.

module(
moduleName: string,
moduleContent: (
hooks: HooksObject<Assert>,
meta: { moduleName: string; options: unknown; context: Record<string, unknown>; }
) => void
): void

Defines a test module (suite) for Deno's BDD test runner.

Wraps describe() from @std/testing/bdd and sets up the QUnit lifecycle (before/beforeEach/afterEach/after hooks, assertion counting, steps tracking).

Examples

Example 1

import { module, test } from "qunitx";

module("Math", (hooks) => {
  hooks.before((assert) => {
    assert.step("before hook ran");
  });

  test("addition", (assert) => {
    assert.equal(2 + 2, 4);
  });
});

Parameters

moduleName: string

Name of the test suite

moduleContent: (
hooks: HooksObject<Assert>,
meta: { moduleName: string; options: unknown; context: Record<string, unknown>; }
) => void

Callback that defines tests and hooks via hooks.before, hooks.beforeEach, hooks.afterEach, hooks.after

Return Type

void
module(
moduleName: string,
runtimeOptions: object,
moduleContent: (
hooks: HooksObject<Assert>,
meta: { moduleName: string; options: unknown; context: Record<string, unknown>; }
) => void
): void

Defines a test module (suite) with optional Deno BDD runtime options forwarded to describe().

Parameters

moduleName: string
runtimeOptions: object
moduleContent: (
hooks: HooksObject<Assert>,
meta: { moduleName: string; options: unknown; context: Record<string, unknown>; }
) => void

Return Type

void