/** The options for creating a test suite with the describe function. */ export interface DescribeDefinition extends Omit { fn?: () => void; /** * The `describe` function returns a `TestSuite` representing the group of tests. * If `describe` is called within another `describe` calls `fn`, the suite will default to that parent `describe` calls returned `TestSuite`. * If `describe` is not called within another `describe` calls `fn`, the suite will default to the `TestSuite` representing the global group of tests. */ suite?: TestSuite; /** Run some shared setup before all of the tests in the suite. */ beforeAll?: ((this: T) => void | Promise) | ((this: T) => void | Promise)[]; /** Run some shared teardown after all of the tests in the suite. */ afterAll?: ((this: T) => void | Promise) | ((this: T) => void | Promise)[]; /** Run some shared setup before each test in the suite. */ beforeEach?: ((this: T) => void | Promise) | ((this: T) => void | Promise)[]; /** Run some shared teardown after each test in the suite. */ afterEach?: ((this: T) => void | Promise) | ((this: T) => void | Promise)[]; } /** The options for creating an individual test case with the it function. */ export interface ItDefinition extends Omit { fn: (this: T) => void | Promise; /** * The `describe` function returns a `TestSuite` representing the group of tests. * If `it` is called within a `describe` calls `fn`, the suite will default to that parent `describe` calls returned `TestSuite`. * If `it` is not called within a `describe` calls `fn`, the suite will default to the `TestSuite` representing the global group of tests. */ suite?: TestSuite; } /** The names of all the different types of hooks. */ export declare type HookNames = "beforeAll" | "afterAll" | "beforeEach" | "afterEach"; /** * A group of tests. */ export interface TestSuite { symbol: symbol; } /** * An internal representation of a group of tests. */ export declare class TestSuiteInternal implements TestSuite { symbol: symbol; protected describe: DescribeDefinition; protected steps: (TestSuiteInternal | ItDefinition)[]; protected hasOnlyStep: boolean; constructor(describe: DescribeDefinition); /** If the test cases have begun executing. */ static running: boolean; /** If a test has been registered yet. Block adding global hooks if a test has been registered. */ static started: boolean; /** A map of all test suites by symbol. */ static suites: Map>; /** The current test suite being registered. */ static current: TestSuiteInternal | null; /** The stack of tests that are actively running. */ static active: symbol[]; /** This is used internally for testing this module. */ static reset(): void; /** This is used internally to register tests. */ static registerTest(options: Deno.TestDefinition): void; /** Updates all steps within top level suite to have ignore set to true if only is not set to true on step. */ static addingOnlyStep(suite: TestSuiteInternal): void; /** This is used internally to add steps to a test suite. */ static addStep(suite: TestSuiteInternal, step: TestSuiteInternal | ItDefinition): void; /** This is used internally to add hooks to a test suite. */ static setHook(suite: TestSuiteInternal, name: HookNames, fn: (this: T) => void | Promise): void; /** This is used internally to run all steps for a test suite. */ static run(suite: TestSuiteInternal, context: T, t: Deno.TestContext): Promise; static runTest(fn: (this: T) => void | Promise, context: T, activeIndex?: number): Promise; }