Skip to content

Commit

Permalink
Merge branch 'main' into es2022-esmodule-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
dsarlo-viso committed Oct 23, 2023
2 parents a7acbeb + 15e9ee4 commit 6e0dd32
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions test/spec/sns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,22 +238,21 @@ describe("test", () => {
expect(state.getPongs()).to.eq(1);
});

// TODO: fix
// it('should support async handlers with no callback', async () => {
// plugin = new ServerlessOfflineSns(createServerless(accountId, "asyncHandler"), {
// skipCacheInvalidation: true,
// });
// const snsAdapter = await plugin.start();
// await snsAdapter.publish(
// `arn:aws:sns:us-east-1:${accountId}:test-topic-async`,
// "{}"
// );
// await new Promise((res) => setTimeout(res, 100));
// expect(await state.getResult()).to.eq(
// `arn:aws:sns:us-east-1:${accountId}:test-topic-async`
// );
// expect(await snsAdapter.Deferred).to.eq("{}");
// });
it('should support async handlers with no callback', async () => {
plugin = new ServerlessOfflineSns(createServerless(accountId, "asyncHandler"), {
skipCacheInvalidation: true,
});
const snsAdapter = await plugin.start();
await snsAdapter.publish(
`arn:aws:sns:us-east-1:${accountId}:test-topic-async`,
"{}"
);
await new Promise((res) => setTimeout(res, 100));
expect(await state.getResult()).to.eq(
`arn:aws:sns:us-east-1:${accountId}:test-topic-async`
);
expect(await snsAdapter.Deferred).to.eq("{}");
});

it("should not send event when filter policies exist and fail", async () => {
plugin = new ServerlessOfflineSns(
Expand Down

0 comments on commit 6e0dd32

Please sign in to comment.