Skip to content

Vitest

src/Vitest.res
type assertion<'a> = {
toBe: 'a => unit,
toStrictEqual: 'a => unit,
not: assertion<'a>,
resolves: assertion<'a>,
rejects: assertion<'a>,
toThrowError: unit => unit,
}

Assertion type for testing values with various matchers.
Provides a fluent API for making assertions in tests.

src/Vitest.res:5:1


src/Vitest.res
let expect: 'a => assertion<'a>

Creates an assertion object for testing a value.
@param value The value to create assertions for
@returns An assertion object with various matcher methods

src/Vitest.res:14:1


src/Vitest.res
let expect: 'a => assertion<'a>

src/Vitest.res:21:5


src/Vitest.res
type testFunction = unit => unit

Function type for synchronous test cases

src/Vitest.res:24:1


src/Vitest.res
let test: (string, testFunction) => unit

Defines a single test case.
@param name The name/description of the test
@param testFn The function containing the test logic

src/Vitest.res:26:1


src/Vitest.res
let test: (string, testFunction) => unit

src/Vitest.res:33:5


src/Vitest.res
type describeFunction = unit => unit

Function type for test suite setup

src/Vitest.res:36:1


src/Vitest.res
let describe: (string, describeFunction) => unit

Groups related tests together in a test suite.
@param name The name/description of the test suite
@param suiteFn The function containing the test suite setup and tests

src/Vitest.res:38:1


src/Vitest.res
let describe: (string, describeFunction) => unit

src/Vitest.res:45:5


src/Vitest.res
type testAsyncFunction = unit => promise<unit>

Function type for asynchronous test cases that return a promise

src/Vitest.res:48:1


src/Vitest.res
let testAsync: (string, testAsyncFunction) => unit

Defines a single asynchronous test case.
@param name The name/description of the test
@param testFn The async function containing the test logic that returns a promise

src/Vitest.res:50:1


src/Vitest.res
let testAsync: (string, testAsyncFunction) => unit

src/Vitest.res:57:5