@testdeck/di-typedi
v0.3.3
Published
TypeDI IOC integration for testdeck
Downloads
1,035
Readme
@testdeck/di-typedi
Integration of the TypeDI IOC.
import { suite, test } from "@testdeck/mocha";
import { expect } from "chai";
// register TypeDI support with testdeck and also let reflect-metadata do it's magic
import "@testdeck/di-typedi";
import "reflect-metadata";
import { Service } from "typedi";
@Service()
class SomeService {
doSomething(): boolean {
return false;
}
}
@suite
class Hello {
constructor(private service: SomeService) {
}
@test
world() {
expect(this.service.doSomething()).to.be.true;
}
}
This also works with the provided integrations for Jasmine and Jest.
If you are looking for other test framework support, please see the following packages
Installation
npm install --save-dev typedi reflect-metadata @testdeck/di-typedi
Additional Information
You can find a lot more information in the official documentation.
Read more about TypeDI.