reactant
Version:
A framework for building React web applications
33 lines • 792 B
TypeScript
import { PartialKeys } from 'reactant-module';
import { Config, App, Renderer } from './interfaces';
/**
* ## Description
*
* You can use `testBed` to build your test code without `render`(`render` function is optional.).
*
* ## Example
*
* ```ts
* @injectable()
* class Bar {
* getValue() {
* return 'bar';
* }
* }
*
* @injectable()
* class Foo {
* constructor(public bar: Bar) {}
* }
*
* const foo = testBed({
* modules: [{ provide: Bar, useValue: { getValue: () => 'test' } }],
* main: Foo,
* });
*
* expect(foo.instance.bar.getValue()).toBe('test');
* ```
*/
declare function testBed<T, S extends any[], R extends Renderer<S>>(config: PartialKeys<Config<T, S, R>, 'render'>): App<T, S, R>;
export { testBed };
//# sourceMappingURL=testBed.d.ts.map