ses_deletereceiptruleset.test.js - AWS Code Sample

ses_deletereceiptruleset.test.js

const mockDeleteReceiptRuleSet = jest.fn(); jest.mock("@aws-sdk/client-ses/commands/DeleteReceiptRuleSetCommand", () => ({ SES: function SES() { this.DeleteReceiptRuleSetCommand = mockDeleteReceiptRuleSet; }, })); const { run } = require("../../ses/src/ses_deletereceiptruleset.js"); //test function test("has to mock SES#deletereceiptruleset", async (done) => { await run(); expect(mockDeleteReceiptRuleSet).toHaveBeenCalled; done(); });