@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 | |
testApp | An app to ask questions of, wired the conventional way. |
checkContract | The declared contract, posed to the façade that will receive it. |
checkOutput | What may leave, checked against what the entity says may leave. |
verdictOf | What a facade answers, in the shape a verdict is compared in. |
stubOf | A double for a port. |
frondOf | The frond a path sits in, or nothing. |
loadScript | A k6 scenario, written from what the app answers. |
reachableOps | Every operation the app answers, with a body for those that take one. |
statementsOf | Every statement the process ran while run ran; refuses when @fougere/adapter-sql is absent. |
spansOf | The steps one call opened: the operation, then what ran under it. Ex: expect(op.selfMs).toBeLessThan(0.1 * op.ms). |
checkDoorContract | Run one hand-written invocation contract through every facade. |
checkDoors | One entity, four facades, the same answers. |
at | Follow a path into a GraphQL answer, tolerating an absence rather than throwing. |
driftOf | |
agrees | |
explain | |
checkAll | The 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 | |
Port | Anything a provider can be declared as: a class the container knows how to build. |
Stub | The double handed in place of a port — one spy per method the port declares. |
Scope | What a test file's position states about its subject. |
CardDrift |