@@ -65,6 +65,15 @@ describe("HTTP Transport Binding Emitter for CloudEvents", () => {
6565 } ) . catch ( expect . fail ) ;
6666 } ) ;
6767
68+ it ( "Provides the HTTP headers for a binary event" , ( ) => {
69+ const headers = emitter . headers ( event ) ;
70+ expect ( headers [ BINARY_HEADERS_1 . TYPE ] ) . to . equal ( event . getType ( ) ) ;
71+ expect ( headers [ BINARY_HEADERS_1 . SPEC_VERSION ] ) . to . equal ( event . getSpecversion ( ) ) ;
72+ expect ( headers [ BINARY_HEADERS_1 . SOURCE ] ) . to . equal ( event . getSource ( ) ) ;
73+ expect ( headers [ BINARY_HEADERS_1 . ID ] ) . to . equal ( event . getId ( ) ) ;
74+ expect ( headers [ BINARY_HEADERS_1 . TIME ] ) . to . equal ( event . getTime ( ) ) ;
75+ } ) ;
76+
6877 it ( "Sends a structured 1.0 CloudEvent if specified" , ( ) => {
6978 emitter . send ( event , { mode : "structured" } )
7079 . then ( ( response ) => {
@@ -128,6 +137,15 @@ describe("HTTP Transport Binding Emitter for CloudEvents", () => {
128137 } ) . catch ( expect . fail ) ;
129138 } ) ;
130139
140+ it ( "Provides the HTTP headers for a binary event" , ( ) => {
141+ const headers = emitter . headers ( event ) ;
142+ expect ( headers [ BINARY_HEADERS_03 . TYPE ] ) . to . equal ( event . getType ( ) ) ;
143+ expect ( headers [ BINARY_HEADERS_03 . SPEC_VERSION ] ) . to . equal ( event . getSpecversion ( ) ) ;
144+ expect ( headers [ BINARY_HEADERS_03 . SOURCE ] ) . to . equal ( event . getSource ( ) ) ;
145+ expect ( headers [ BINARY_HEADERS_03 . ID ] ) . to . equal ( event . getId ( ) ) ;
146+ expect ( headers [ BINARY_HEADERS_03 . TIME ] ) . to . equal ( event . getTime ( ) ) ;
147+ } ) ;
148+
131149 it ( "Sends a structured 0.3 CloudEvent if specified" , ( ) => {
132150 emitter . send ( event , { mode : "structured" , foo : "bar" } )
133151 . then ( ( response ) => {
0 commit comments