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

Commit c655b4d

Browse files
committed
add test coverage
1 parent db4f623 commit c655b4d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/shared/bindings.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,24 @@ describe("Bindings", () => {
5050
});
5151
});
5252

53+
it("Gets the warmup binding with default settings", async () => {
54+
const serverless = MockFactory.createTestServerless();
55+
const parsedBindings = await BindingUtils.getBindingsMetaData(serverless);
56+
const bindingType = "warmupTrigger";
57+
58+
const bindingTypes = parsedBindings.bindingTypes;
59+
const bindingTypeIndex = bindingTypes.indexOf(bindingType);
60+
const bindingSettings = parsedBindings.bindingSettings[bindingTypeIndex];
61+
62+
const binding = BindingUtils.getBinding(bindingType, bindingSettings, {});
63+
64+
expect(binding).toMatchObject({
65+
type: "warmupTrigger",
66+
direction: "in",
67+
name: "warmupContext",
68+
});
69+
});
70+
5371
it("Gets the http binding with custom name", async () => {
5472
const serverless = MockFactory.createTestServerless();
5573
const parsedBindings = await BindingUtils.getBindingsMetaData(serverless);

0 commit comments

Comments
 (0)