r/javascript • u/_ilamy • Mar 21 '26
testoise - lazy, type-safe test variables for Bun, Vitest, and Jest (inspired by RSpec)
github.comBuilt a small library that replaces the let + beforeEach reassignment pattern with RSpec-style lazy variables. Define with def, access with get. Variables evaluate lazily, cache per test, and dependents re-evaluate automatically when overridden in nested blocks. Fully type-safe with a suite wrapper for automatic TypeScript inference.
Zero dependencies, MIT licensed. Feedback welcome!