MCPcopy Create free account
hub / github.com/ctrlplusb/react-injectables / assertIsValidInjector

Function assertIsValidInjector

test/Injector.test.js:15–25  ·  view source on GitHub ↗
(injectorInstance)

Source from the content-addressed store, hash-verified

13 let ValidInjectable;
14
15 function assertIsValidInjector(injectorInstance) {
16 const actual = typeof injectorInstance === `function` &&
17 !!injectorInstance.contextTypes &&
18 !!injectorInstance.contextTypes.registerInjector &&
19 !!injectorInstance.contextTypes.updateInjector &&
20 !!injectorInstance.contextTypes.removeInjector;
21
22 const expected = true;
23
24 expect(actual).to.equal(expected, `Invalid Injector created.`);
25 }
26
27 beforeEach(() => {
28 ValidInjectable = Injectable(() => <div>foo</div>);

Callers 1

Injector.test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected