From b4266b1f378d16c796aa4b7c5bbdbda8d9f8c1e8 Mon Sep 17 00:00:00 2001 From: Lance Ball Date: Tue, 23 Nov 2021 18:05:15 -0500 Subject: [PATCH] chore: add test for text/plain data (#442) Signed-off-by: Lance Ball --- test/integration/message_test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/integration/message_test.ts b/test/integration/message_test.ts index 5246aca..c500664 100644 --- a/test/integration/message_test.ts +++ b/test/integration/message_test.ts @@ -64,6 +64,19 @@ describe("HTTP transport", () => { expect(HTTP.isEvent(message)).to.be.true; }); + it("Handles CloudEvents with datacontenttype of text/plain", () => { + const message: Message = HTTP.binary( + new CloudEvent({ + source: "/test", + type: "example", + datacontenttype: "text/plain", + data: "Hello, friends!", + }), + ); + const event = HTTP.toEvent(message); + expect(event.validate()).to.be.true; + }); + it("Respects extension attribute casing (even if against spec)", () => { // Now create a message that is an event const message = {