This PR implements two new methods on the pumpit class validate and validateSafe. These methods check if dependency keys that are used for injection are present in the container. It will not instantiate any classes or run factory functions.
given this example:
class TestA {
constructor() {
throw new Error("Class should not be instantiated")
}
}
class TestB {
static inject = [TestA]
constructor(public a: TestA) {
throw new Error("Class should not be instantiated")
}
}
pumpIt.bindClass(TestA, TestA).bindClass(TestB, TestB)
pumpIt.validate()
It will check if class TestA is registered with the container, because class TestB has it as a dependency.
This PR implements two new methods on the pumpit class
validate
andvalidateSafe
. These methods check if dependency keys that are used for injection are present in the container. It will not instantiate any classes or run factory functions.given this example:
It will check if class
TestA
is registered with the container, because classTestB
has it as a dependency.