Allows the injection of an intermediate class between a child class and its
parent, enabling the testing of calls to the super() call.
- Source:
Classes
Methods
(static) inject(Parent, Child) → {module:superSpy~SpyClass}
- Source:
Injects a spy class between a parent and child class. The spy class will
always mirror all calls to the constructor to a sinon spy that can be
inspected to perform tests on constructor calls, specifically allowing
calls to super() to be tested.
Parameters:
Name | Type | Description |
---|---|---|
Parent |
Class | The parent class reference |
Child |
function | The child class reference |
Returns:
A reference to the spy class, that in
turn allows the inspection of constructor calls.