Skip to content

Test ​

The global Test.

Functions ​

  • Test.test(name: string, body: () -> ()): ()
  • Test.describe(name: string, body: () -> ()): ()
  • Test.skip(name: string, body: (() -> ())?): ()
  • Test.beforeAll(hook: () -> ()): ()
  • Test.beforeEach(hook: () -> ()): ()
  • Test.afterEach(hook: () -> ()): ()
  • Test.afterAll(hook: () -> ()): ()
  • Test.expect(value: any): TestExpectation

Types ​

luau
export type TestExpectation = {
	toBe: (expected: any) -> (),
	toEqual: (expected: any) -> (),
	toBeNil: () -> (),
	toBeTruthy: () -> (),
	toBeFalsy: () -> (),
	toBeCloseTo: (expected: number, digits: number?) -> (),
	toBeGreaterThan: (expected: any) -> (),
	toBeGreaterThanOrEqual: (expected: any) -> (),
	toBeLessThan: (expected: any) -> (),
	toBeLessThanOrEqual: (expected: any) -> (),
	toContain: (item: any) -> (),
	toHaveLength: (length: number) -> (),
	toBeA: (typeName: string) -> (),
	toThrow: (message: string?) -> (),
	never: TestExpectation,
}

Apache License 2.0