we use your library in our backends and we like it very much. I just updated to the new 3.0 version and bumped across your Snapshot change. For our unit tests, it would be handy if the Snapshot type would directly be exported by your library.
Right now we must write our tests like this:
import { Container } from "typescript-ioc";
import { Snapshot } from "typescript-ioc/dist/model";
describe("SomeController", () => {
let controller: TestController;
let dbService: DatabaseService;
let dbServiceSnapshot: Snapshot;
beforeEach(() => {
dbServiceSnapshot = Container.snapshot(DatabaseService);
Container.bind(DatabaseService).factory(() => dbService);
controller = new TestController();
});
afterEach(() => {
dbServiceSnapshot.restore();
});
});
For convenience it would be cool, if we don't have to import the Snapshot from the dist directory.
Edit:
For bonus points it would be very awesome if the ObjectFactory type would be generic. Our factories look like this:
If we could specify it as const configServiceFactory: ObjectFactory<ConfigurationService> the compiler would tell us, if we return a wrong class for example.
Hello,
we use your library in our backends and we like it very much. I just updated to the new 3.0 version and bumped across your Snapshot change. For our unit tests, it would be handy if the Snapshot type would directly be exported by your library.
Right now we must write our tests like this:
For convenience it would be cool, if we don't have to import the Snapshot from the dist directory.
Edit: For bonus points it would be very awesome if the ObjectFactory type would be generic. Our factories look like this:
If we could specify it as
const configServiceFactory: ObjectFactory<ConfigurationService>
the compiler would tell us, if we return a wrong class for example.