@ecfjs/testing
v1.0.0-rc.2
Published
ECF testing toolkit with DI contexts, HTTP assertions, model factories, time travel, snapshots, and benchmarks
Downloads
152
Maintainers
Readme
@ecfjs/testing — Enterprise Test Platform
@ecfjs/testing is the DI-aware test runner, fakes orchestrator, and benchmark engine for the ECF (Elegant Core Framework) ecosystem.
Features
- TestRunner — native
node:testwrapper with DI sandbox - TestApplication — isolated application instance per test
- TestHttpClient — HTTP integration testing without a live server
- TestDatabase — in-memory database factory for model tests
- FakesOrchestrator — unified fake registration (
Queue.fake(),Cache.fake(), etc.) - TimeTravel — deterministic date/time manipulation in tests
- BenchmarkEngine — package and ecosystem performance benchmarking
- SnapshotTesting — snapshot assertion utilities
Quick Start
import { describe, it, TestApplication } from "@ecfjs/testing";
import assert from "node:assert/strict";
describe("UserService", () => {
it("creates a user", async () => {
const app = await TestApplication.create();
const result = await app.make("userService").create({ name: "Alice" });
assert.equal(result.name, "Alice");
});
});Documentation
- ARCHITECTURE.md — package architecture
License
MIT
