test: add a test for extension names with all caps. (#389)

See: https://github.com/cloudevents/sdk-javascript/issues/380

Signed-off-by: Lance Ball <lball@redhat.com>
This commit is contained in:
Lance Ball 2021-03-08 16:07:24 -05:00 committed by GitHub
parent b006b90122
commit e7d99eb882
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -61,6 +61,12 @@ describe("A CloudEvent", () => {
new CloudEvent({ "123456789012345678901": "extension1", ...fixture }); new CloudEvent({ "123456789012345678901": "extension1", ...fixture });
}).throw("invalid extension name"); }).throw("invalid extension name");
}); });
it("Throws a validation error for invalid uppercase extension names", () => {
expect(() => {
new CloudEvent({ ExtensionWithCaps: "extension value", ...fixture });
}).throw("invalid extension name");
});
}); });
describe("A 1.0 CloudEvent", () => { describe("A 1.0 CloudEvent", () => {