QUnitX — universal test library that runs the same test file in Node.js, Deno, and browser.
The assertion object passed to every test callback and lifecycle hook.
- AssertionError: AssertionErrorConstructor
- QUnit: QUnitObject
-
async(): () => void
Returns a
donecallback for callback-style async tests. The test will not finish until everydonecallback returned byasync()has been called. -
deepEqual(): voidactual: unknown,expected: unknown,message?: string
Asserts deep equality between
actualandexpectedusing recursive structural comparison. Handles nested objects, arrays,Date,RegExp, and more. -
equal(): voidactual: unknown,expected: unknown,message?: string
Asserts that
actual == expected(loose equality, allows type coercion). -
expect(number: number): void
Sets the number of assertions expected to run in the current test. The test fails if a different number of assertions actually ran.
-
false(): voidstate: unknown,message?: string
Asserts that
state === false(strict boolean false). - inspect: InspectFn
-
notDeepEqual(): voidactual: unknown,expected: unknown,message?: string
Asserts that
actualandexpectedare NOT deeply equal. Inverse ofAssert.prototype.deepEqual. -
notEqual(): voidactual: unknown,expected: unknown,message?: string
Asserts that
actual != expected(loose inequality). Inverse ofAssert.prototype.equal. -
notOk(): voidstate: unknown,message?: string
Asserts that
stateis falsy. -
notPropContains(): voidactual: unknown,expected: unknown,message?: string
Asserts that
actualdoes NOT contain all own enumerable properties fromexpectedwith matching values. Inverse ofAssert.prototype.propContains. -
notPropEqual(): voidactual: unknown,expected: unknown,message?: string
Asserts that
actualandexpecteddo NOT have the same own enumerable properties and values. Inverse ofAssert.prototype.propEqual. -
notStrictEqual(): voidactual: unknown,expected: unknown,message?: string
Asserts that
actual !== expected(strict inequality). Inverse ofAssert.prototype.strictEqual. -
ok(): voidstate: unknown,message?: string
Asserts that
stateis truthy. -
propContains(): voidactual: unknown,expected: unknown,message?: string
Asserts that
actualcontains all own enumerable properties fromexpectedwith matching values. Extra properties onactualare allowed and ignored. -
propEqual(): voidactual: unknown,expected: unknown,message?: string
Asserts that
actualandexpectedhave the same own enumerable properties and values. Prototype methods are ignored; only own properties are compared. -
pushResult(resultInfo?: PushResultInfo): this
Pushes a custom assertion result. Fails the test if
resultInfo.resultis falsy. Throws anAssertionErroron failure. -
rejects(): Promise<void>promise: unknown,expectedInput?: unknown,assertionMessage?: string
Asserts that a promise rejects. Optionally validates the rejection reason against a string (message substring), RegExp (message pattern), or constructor (
instanceofcheck). For synchronous throws useAssert.prototype.throws. -
step(message: string): void
Records a named step. Use with
Assert.prototype.verifyStepsto assert that a sequence of steps occurred in the right order. -
strictEqual(): voidactual: unknown,expected: unknown,message?: string
Asserts that
actual === expected(strict equality, no type coercion). - test: TestState
-
throws(): voidblockFn: unknown,expectedInput?: unknown,assertionMessage?: string
Asserts that
blockFnthrows an exception. Optionally validates the thrown error against a string (message substring), RegExp (message pattern), or constructor (instanceofcheck). For async functions useAssert.prototype.rejects. -
timeout(number: number): void
Sets the number of milliseconds after which the current test will fail if not yet complete.
-
true(): voidstate: unknown,message?: string
Asserts that
state === true(strict boolean true). -
verifySteps(): voidsteps: string[],message?: string
Asserts that the steps recorded via
Assert.prototype.stepmatch the given array, then clears the recorded steps. - waitForAsyncOps(): Promise<void[]>
Thrown when an assertion fails. Extends Deno's built-in AssertionError
so it integrates cleanly with Deno's test runner output.
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.
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.
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.
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.
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.
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.
| ((
Defines an individual test within a module for Deno's BDD test runner.
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.
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.
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.
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).
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).
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).
The default export provides the full QUnitX API as a single object.
Registers a skipped test. Equivalent to test.skip. The test body is never
executed and the test is reported as ignored by Deno's runner.