@bunito/testing
v0.0.27
Published
Testing helpers, mock utilities, and shared test context factories for bunito packages.
Maintainers
Readme
@bunito/testing
Testing helpers, mock utilities, and a shared test context for bunito packages.
It provides the global Test context, defineTestFactory(), mockClass(), and
spyOnObject() helpers used by package tests.
Installation 📦
bun add @bunito/testingUsage ✨
import { Test, defineTestFactory, mockClass } from '@bunito/testing';
class Service {
run(): string {
return 'ok';
}
}
declare global {
namespace Bunito {
interface Test {
service: Service;
}
}
}
defineTestFactory('service', () => mockClass(Service));
const service = Test.service;License
MIT
