Skip to content

Commit b4266b1

Browse files
authored
chore: add test for text/plain data (#442)
Signed-off-by: Lance Ball <lball@redhat.com>
1 parent f7b2840 commit b4266b1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/integration/message_test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,19 @@ describe("HTTP transport", () => {
6464
expect(HTTP.isEvent(message)).to.be.true;
6565
});
6666

67+
it("Handles CloudEvents with datacontenttype of text/plain", () => {
68+
const message: Message = HTTP.binary(
69+
new CloudEvent({
70+
source: "/test",
71+
type: "example",
72+
datacontenttype: "text/plain",
73+
data: "Hello, friends!",
74+
}),
75+
);
76+
const event = HTTP.toEvent(message);
77+
expect(event.validate()).to.be.true;
78+
});
79+
6780
it("Respects extension attribute casing (even if against spec)", () => {
6881
// Now create a message that is an event
6982
const message = {

0 commit comments

Comments
 (0)