Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
add test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jdaviderb committed Oct 11, 2021
1 parent db4f623 commit c655b4d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/shared/bindings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,24 @@ describe("Bindings", () => {
});
});

it("Gets the warmup binding with default settings", async () => {
const serverless = MockFactory.createTestServerless();
const parsedBindings = await BindingUtils.getBindingsMetaData(serverless);
const bindingType = "warmupTrigger";

const bindingTypes = parsedBindings.bindingTypes;
const bindingTypeIndex = bindingTypes.indexOf(bindingType);
const bindingSettings = parsedBindings.bindingSettings[bindingTypeIndex];

const binding = BindingUtils.getBinding(bindingType, bindingSettings, {});

expect(binding).toMatchObject({
type: "warmupTrigger",
direction: "in",
name: "warmupContext",
});
});

it("Gets the http binding with custom name", async () => {
const serverless = MockFactory.createTestServerless();
const parsedBindings = await BindingUtils.getBindingsMetaData(serverless);
Expand Down

0 comments on commit c655b4d

Please sign in to comment.