forked from PluralFlux/PluralFlux
adjusted tests to properly use mockRejectedValue for async rejections
This commit is contained in:
@@ -160,9 +160,7 @@ describe('webhookHelper', () => {
|
||||
// Arrange
|
||||
message.guildId = '123';
|
||||
messageHelper.parseProxyTags.mockResolvedValue(proxyMessage);
|
||||
jest.spyOn(webhookHelper, 'replaceMessage').mockImplementation(() => {
|
||||
throw new Error("error")
|
||||
});
|
||||
jest.spyOn(webhookHelper, 'replaceMessage').mockRejectedValue(new Error("error"));
|
||||
// Act
|
||||
await expect(webhookHelper.sendMessageAsMember(client, message)).rejects.toThrow("error");
|
||||
// Assert
|
||||
|
||||
Reference in New Issue
Block a user