Interface DescribeDefinition<T>
afterAll?: ((this: T) => void | Promise<void>) | ((this: T) => void | Promise<void>)[];
afterEach?: ((this: T) => void | Promise<void>) | ((this: T) => void | Promise<void>)[];
beforeAll?: ((this: T) => void | Promise<void>) | ((this: T) => void | Promise<void>)[];
beforeEach?: ((this: T) => void | Promise<void>) | ((this: T) => void | Promise<void>)[];
fn?: (() => undefined | void);
ignore?: boolean;
name: string;
only?: boolean;
permissions?: PermissionOptions;
sanitizeExit?: boolean;
sanitizeOps?: boolean;
sanitizeResources?: boolean;
suite?: TestSuite<T>;
}
Type Parameters
Hierarchy
- Omit<Deno.TestDefinition, "fn">
- DescribeDefinition
Properties
OptionalafterAll
Run some shared teardown after all of the tests in the suite.
OptionalafterEach
Run some shared teardown after each test in the suite.
OptionalbeforeAll
Run some shared setup before all of the tests in the suite.
OptionalbeforeEach
Run some shared setup before each test in the suite.
Optionalfn
The body of the test suite
Optionalignore
If truthy the current test step will be ignored.
It is a quick way to skip over a step, but also can be used for conditional logic, like determining if an environment feature is present.
name
The name of the test.
Optionalonly
If at least one test has only set to true, only run tests that have
only set to true and fail the test suite.
Optionalpermissions
Specifies the permissions that should be used to run the test.
Set this to "inherit" to keep the calling runtime permissions, set this to "none" to revoke all permissions, or set a more specific set of permissions using a PermissionOptionsObject.
OptionalsanitizeExit
Ensure the test case does not prematurely cause the process to exit, for example via a call to Deno.exit.
OptionalsanitizeOps
Check that the number of async completed operations after the test step is the same as number of dispatched operations. This ensures that the code tested does not start async operations which it then does not await. This helps in preventing logic errors and memory leaks in the application code.
OptionalsanitizeResources
Ensure the test step does not "leak" resources - like open files or network connections - by ensuring the open resources at the start of the test match the open resources at the end of the test.
Optionalsuite
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.
The options for creating a test suite with the describe function.