send(message) {
this.test.send(name, message, err => {
if (err) {
this.logger.info('error', err);
return;
}
this._logger.info('successfully sent');
});
}
мой тест:
testClass.send ({value: 'hey'});
expect(sendSpy.mock.calls[0][0]).toEqual(name); // this works
expect(sendSpy.mock.calls[0][1]).toEqual(message); // this works
expect(sendSpy.mock.calls[0][2]).toBe(expect.anything) // this doesnt.
Как я могу подтвердить обратный вызов ошибки, чтобы покрыть вселинии?