Skip to main content
Module

x/collections/test_deps.ts>TestSuite

Collection data structures that are not standard built-in objects in JavaScript. This includes a vector (double-ended queue), binary heap (priority queue), binary search tree, and a red black tree.
Very Popular
Go to Latest
class TestSuite
import { TestSuite } from "https://deno.land/x/collections@0.11.2/test_deps.ts";

A group of tests. A test suite can include child test suites. The name of the test suite is prepended to the name of each test within it. Tests belonging to a suite will inherit options from it.

Constructors

new
TestSuite(options: TestSuiteDefinition<T>)

Properties

private
afterAll: () => Promise<void>

Run some shared teardown after all of the tests in the suite.

private
afterEach: (context: T) => Promise<void>

Run some shared teardown after each test in the suite.

private
beforeAll: () => Promise<void>

Run some shared setup before all of the tests in the suite.

private
optional
beforeAllMetrics: Deno.Metrics
private
optional
beforeAllResources: Deno.ResourceMap
private
beforeEach: (context: T) => Promise<void>

Run some shared setup before each test in the suite.

private
optional
context: Partial<T>

The context for tests within the suite.

private
optional
ignore: boolean

Ignore all tests in suite if set to true.

private
optional
last: string

Full name of the last test in the suite.

private
locked: boolean
private
name: string

The name of the test suite will be prepended to the names of tests in the suite.

private
optional
only: boolean

If at least one test suite or test has only set to true, only run test suites and tests that have only set to true.

private
optional
sanitizeOps: boolean

Check that the number of async completed ops after the suite and each test in the suite is the same as the number of dispatched ops. Defaults to true.

private
optional
sanitizeResources: boolean

Ensure the suite and test cases in the suite do not "leak" resources - ie. the resource table after each test has exactly the same contents as before each test. Defaults to true.

private
started: boolean
private
optional
suite: TestSuite<T>

The parent test suite that the test suite belongs to. Any option that is not specified will be inherited from the parent test suite.

Static Methods

init(): void

Initializes global test suite. This should not be used in your tests. This is used internally and for testing the test suite module.

The function used to register tests. Defaults to using Deno.test.

reset(): void

Resets global test suite. This should not be used in your tests. This is used for testing the test suite module.

test<T>(name: string, fn:
| (() => void)
| (() => Promise<void>)
| ((context: T) => void)
| ((context: T) => Promise<void>)
): void

Register a test which will run when deno test is used on the command line and the containing module looks like a test module.

test<T>(
suite: TestSuite<T> | TestSuite<Partial<T>> | TestSuite<void>,
name: string,
fn:
| (() => void)
| (() => Promise<void>)
| ((context: T) => void)
| ((context: T) => Promise<void>)
,
): void
test<T>(options: TestDefinition<T>): void