The type of mocked object.
const ipcRendererMock = new StrictMock<typeof ipcRenderer>()
.setup(instance => instance.on(ipcRendererChannelName, It.IsAny()))
.callback(({args: [channel, listener]}) => listener(undefined, response));
A callback function that will intercept the interaction. The function may returns a value that will be provided as result (see returns)
Replicates interactions with original object. The mock object keeps tracking all interactions and reflects them on the original object.
const value = 2;
class Origin {
public property = value;
}
const origin = new Origin();
const mock = new Mock<Origin>()
.setup(() => It.IsAny())
.mimics(origin);
const actual = mock.object().property;
expect(actual).toBe(2);
Plays the setup on target invocation when predicate returns true otherwise the setup will be ignored. As predicate PlayTimes could be used.
Returns the provided value as a result of interaction in case of
Controls write operation in case of
The value
Returns the provided value with a resolved Promise as a result of invocation an asynchronous function
The value
Generated using TypeDoc
Sets a behaviour rule for a particular use case