我想在创建后使用 inversify 的 @injectable 装饰器更新一个类;用例是我想使用像 ts-auto-mock 这样的模拟库为我创建一个模拟,然后应用 @injectable 装饰器,这样我就可以将模拟绑定到服务类型。
const mockExampleService = createMock<ExampleService>();
// I want to apply the @injectable decorator to mockExampleService here
// inversify.unit-config.ts
const container = new Container();
const.bind<ExampleService>(TYPES.ExampleService).to(mockExampleService);