Interface: TestContext¶
Context object passed to the describe() callback for registering tests and lifecycle hooks.
Since¶
0.22.0
Example¶
JavaScript
gaslamp.JestLite.describe("MyModule", (ctx) => {
ctx.beforeAll(() => { setup(); });
ctx.test("does something", () => { expect(true).toBe(true); });
});
Properties¶
test¶
test: (
description,testFn) =>void
Register a test case.
Parameters¶
description¶
string
testFn¶
(expect) => void
Returns¶
void
beforeAll¶
beforeAll: (
fn) =>void
Register a setup function to run once before all tests.
Parameters¶
fn¶
() => void
Returns¶
void
afterAll¶
afterAll: (
fn) =>void
Register a cleanup function to run once after all tests.
Parameters¶
fn¶
() => void
Returns¶
void
beforeEach¶
beforeEach: (
fn) =>void
Register a function to run before each test.
Parameters¶
fn¶
() => void
Returns¶
void
afterEach¶
afterEach: (
fn) =>void
Register a function to run after each test.
Parameters¶
fn¶
() => void
Returns¶
void
it?¶
optionalit?: (description,testFn) =>void
Alias for test().
Parameters¶
description¶
string
testFn¶
(expect) => void
Returns¶
void