@fougere/testing

Tests derived from the declaration — cases, stubs and a gradient of realities.

Entries: @fougere/testing · @fougere/testing/load · @fougere/testing/vitest

What you import

name
sampleInput
Cases
testAppAn app to ask questions of, wired the conventional way.
checkContractThe declared contract, posed to the façade that will receive it.
checkOutputWhat may leave, checked against what the entity says may leave.
verdictOfWhat a facade answers, in the shape a verdict is compared in.
stubOfA double for a port.
frondOfThe frond a path sits in, or nothing.
loadScriptA k6 scenario, written from what the app answers.
reachableOpsEvery operation the app answers, with a body for those that take one.
statementsOfEvery statement the process ran while run ran; refuses when @fougere/adapter-sql is absent.
spansOfThe steps one call opened: the operation, then what ran under it. Ex: expect(op.selfMs).toBeLessThan(0.1 * op.ms).
checkDoorContractRun one hand-written invocation contract through every facade.
checkDoorsOne entity, four facades, the same answers.
atFollow a path into a GraphQL answer, tolerating an absence rather than throwing.
driftOf
agrees
explain
checkAllThe whole suite, for every entity, from a file that names none of them.

Types

TypeScript types only — they do not run. Import them with import type to type your own code: a variable, a parameter, an option object.

name
ValidationCase
Verdict
PortAnything a provider can be declared as: a class the container knows how to build.
StubThe double handed in place of a port — one spy per method the port declares.
ScopeWhat a test file's position states about its subject.
CardDrift
Built with Fougere and Nuxt, hosted on GitHub Pages.