the<T extends Testing,U,>(): Step<T, void>
Test case. Consists of name and zero or more test steps.
- Steps run in sequence. If no step throws, the case passes.
- Empty case like
the('empty')amounts tothe('empty', todo()). - Stringy step like
the('empty', 'string')amounts tothe('empty', the('string')) - Falsy step like
the('something', null)is only counted.
Example:
import { suite, the, ok, equal } from '@hackbg/fadroma'; export const test1 = the('Thing', _ => ok(1 == 1) // unnamed step (sync) async _ => ok(await something() != 5) // unnamed step (async) ); export const test2 = the('Other', test1, // include defined substep the('named step', _ => equal(1, 1)), // define named substep in place the('renamed step', test1) // rename defined substep ); export default suite(import.meta, 'Test suite', test2);
T extends Testing