Vitest
assertion
Section titled “assertion”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
expect
Section titled “expect”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
testFunction
Section titled “testFunction”type testFunction = unit => unit
Function type for synchronous test cases
src/Vitest.res:24:1
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
let test: (string, testFunction) => unit
src/Vitest.res:33:5
describeFunction
Section titled “describeFunction”type describeFunction = unit => unit
Function type for test suite setup
src/Vitest.res:36:1
describe
Section titled “describe”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
describe
Section titled “describe”let describe: (string, describeFunction) => unit
src/Vitest.res:45:5
testAsyncFunction
Section titled “testAsyncFunction”type testAsyncFunction = unit => promise<unit>
Function type for asynchronous test cases that return a promise
src/Vitest.res:48:1
testAsync
Section titled “testAsync”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
testAsync
Section titled “testAsync”let testAsync: (string, testAsyncFunction) => unit
src/Vitest.res:57:5