function test

Additional properties on the test function.

Functions

f
test.skipTest(
testName: string,
_testContent?: unknown
): void

Registers a skipped test. Equivalent to QUnit.test.skip. The test body is never executed; the test is reported as ignored by Deno's runner.

f
test.todoTest(
testName: string,
_testContent?: unknown
): void

Registers a todo test. Equivalent to QUnit.test.todo. The test body is never executed; the test is reported as ignored by Deno's runner (Deno has no native todo concept).

Additional properties on the test function.

Functions

f
test.skipTest(
testName: string,
_testContent?: unknown
): void

Registers a skipped test. Equivalent to QUnit.test.skip. The test body is never executed; the test is reported as ignored by Deno's runner.

f
test.todoTest(
testName: string,
_testContent?: unknown
): void

Registers a todo test. Equivalent to QUnit.test.todo. The test body is never executed; the test is reported as ignored by Deno's runner (Deno has no native todo concept).

Additional properties on the test function.

Functions

f
test.skipTest(
testName: string,
_testContent?: unknown
): void

Registers a skipped test. Equivalent to QUnit.test.skip. The test body is never executed; the test is reported as ignored by Deno's runner.

f
test.todoTest(
testName: string,
_testContent?: unknown
): void

Registers a todo test. Equivalent to QUnit.test.todo. The test body is never executed; the test is reported as ignored by Deno's runner (Deno has no native todo concept).

test(
testName: string,
testContent: (
assert: Assert,
meta: { testName: string; options: unknown; context: Record<string, unknown>; }
) => void | Promise<void>
): void

Defines an individual test within a module for Deno's BDD test runner.

Wraps it() from @std/testing/bdd and handles the full QUnit lifecycle: beforeEach/afterEach hooks, async assertion waiting, and step verification.

Must be called inside a module() callback.

Examples

Example 1

import { module, test } from "qunitx";

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

  test("async resolves correctly", async (assert) => {
    const result = await Promise.resolve(42);
    assert.strictEqual(result, 42);
  });
});

Parameters

testName: string

Name of the test

testContent: (
assert: Assert,
meta: { testName: string; options: unknown; context: Record<string, unknown>; }
) => void | Promise<void>

Test callback receiving (assert, { testName, options })

Return Type

void
test(
testName: string,
runtimeOptions: object,
testContent: (
assert: Assert,
meta: { testName: string; options: unknown; context: Record<string, unknown>; }
) => void | Promise<void>
): void

Defines an individual test with optional Deno BDD runtime options forwarded to it().

Parameters

testName: string
runtimeOptions: object
testContent: (
assert: Assert,
meta: { testName: string; options: unknown; context: Record<string, unknown>; }
) => void | Promise<void>

Return Type

void
namespace test

Additional properties on the test function.

Functions

f
test.skipTest(
testName: string,
_testContent?: unknown
): void

Registers a skipped test. Equivalent to QUnit.test.skip. The test body is never executed; the test is reported as ignored by Deno's runner.

f
test.todoTest(
testName: string,
_testContent?: unknown
): void

Registers a todo test. Equivalent to QUnit.test.todo. The test body is never executed; the test is reported as ignored by Deno's runner (Deno has no native todo concept).

Additional properties on the test function.

Functions

f
test.skipTest(
testName: string,
_testContent?: unknown
): void

Registers a skipped test. Equivalent to QUnit.test.skip. The test body is never executed; the test is reported as ignored by Deno's runner.

f
test.todoTest(
testName: string,
_testContent?: unknown
): void

Registers a todo test. Equivalent to QUnit.test.todo. The test body is never executed; the test is reported as ignored by Deno's runner (Deno has no native todo concept).

Additional properties on the test function.

Functions

f
test.skipTest(
testName: string,
_testContent?: unknown
): void

Registers a skipped test. Equivalent to QUnit.test.skip. The test body is never executed; the test is reported as ignored by Deno's runner.

f
test.todoTest(
testName: string,
_testContent?: unknown
): void

Registers a todo test. Equivalent to QUnit.test.todo. The test body is never executed; the test is reported as ignored by Deno's runner (Deno has no native todo concept).

test(
testName: string,
testContent: (
assert: Assert,
meta: { testName: string; options: unknown; context: Record<string, unknown>; }
) => void | Promise<void>
): void

Defines an individual test within a module for Deno's BDD test runner.

Wraps it() from @std/testing/bdd and handles the full QUnit lifecycle: beforeEach/afterEach hooks, async assertion waiting, and step verification.

Must be called inside a module() callback.

Examples

Example 1

import { module, test } from "qunitx";

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

  test("async resolves correctly", async (assert) => {
    const result = await Promise.resolve(42);
    assert.strictEqual(result, 42);
  });
});

Parameters

testName: string

Name of the test

testContent: (
assert: Assert,
meta: { testName: string; options: unknown; context: Record<string, unknown>; }
) => void | Promise<void>

Test callback receiving (assert, { testName, options })

Return Type

void
test(
testName: string,
runtimeOptions: object,
testContent: (
assert: Assert,
meta: { testName: string; options: unknown; context: Record<string, unknown>; }
) => void | Promise<void>
): void

Defines an individual test with optional Deno BDD runtime options forwarded to it().

Parameters

testName: string
runtimeOptions: object
testContent: (
assert: Assert,
meta: { testName: string; options: unknown; context: Record<string, unknown>; }
) => void | Promise<void>

Return Type

void