TESTING
v0.1.0 — Testing helpers for Hyper apps — app.test, fakeRequest, matchers, memory stores, fuzz.
$ hyper add testing
Copies 13 files into src/hyper/testing/ and updates hyper.lock.json.
DEPS
- registry: core
FILES
- testing/assert.ts
- testing/auth.ts
- testing/call.ts
- testing/capture.ts
- testing/clock.ts
- testing/fuzz.ts
- testing/index.ts
- testing/memory-stores.ts
- testing/mock-ctx.ts
- testing/mock-plugin.ts
- testing/request.ts
- testing/snapshot.ts
- testing/types.ts
README
@hyper/testing
Testing helpers for Hyper apps — call, matchers, memory stores, fuzz.
Install
Components are installed as source into your repo, not pulled from npm:
bunx hyper add testing
Wires the alias @hyper/testing to src/hyper/testing/ (configurable in hyper.config.json). See hyperjs.ai for the full registry.
Usage
import { Hyper, ok } from "@hyper/core"
import { assertResponse, call } from "@hyper/testing"
const app = new Hyper().get("/", () => ok({ hello: "world" }))
const res = await call(app, "GET", "/")
assertResponse(res).isOk()
call accepts both Hyper instances and built HyperApp values, so the same helper works for unit and integration tests.
Docs
See the main README and docs/ for guides and integration recipes.
License
MIT
MANIFEST
- /r/testing.json — latest
- /r/testing@0.1.0.json — immutable