@@ -51,7 +51,7 @@ describe("HTTP Transport Binding Emitter for CloudEvents", () => {
51
51
[ ext3Name ] : ext3Value ,
52
52
} ) ;
53
53
54
- it ( "Sends a binary 1.0 CloudEvent by default" , ( ) => {
54
+ it ( "Sends a binary 1.0 CloudEvent by default" , ( ) =>
55
55
emitter
56
56
. send ( event )
57
57
. then ( ( response : AxiosResponse ) => {
@@ -66,8 +66,7 @@ describe("HTTP Transport Binding Emitter for CloudEvents", () => {
66
66
expect ( response . data [ `${ CONSTANTS . EXTENSIONS_PREFIX } ${ ext2Name } ` ] ) . to . equal ( ext2Value ) ;
67
67
expect ( response . data [ `${ CONSTANTS . EXTENSIONS_PREFIX } ${ ext3Name } ` ] . value ) . to . equal ( ext3Value . value ) ;
68
68
} )
69
- . catch ( expect . fail ) ;
70
- } ) ;
69
+ . catch ( expect . fail ) ) ;
71
70
72
71
it ( "Provides the HTTP headers for a binary event" , ( ) => {
73
72
const headers = headersFor ( event ) ;
@@ -78,7 +77,7 @@ describe("HTTP Transport Binding Emitter for CloudEvents", () => {
78
77
expect ( headers [ CONSTANTS . CE_HEADERS . TIME ] ) . to . equal ( event . time ) ;
79
78
} ) ;
80
79
81
- it ( "Sends a binary CloudEvent with Custom Headers" , ( ) => {
80
+ it ( "Sends a binary CloudEvent with Custom Headers" , ( ) =>
82
81
emitter
83
82
. send ( event , { headers : { customheader : "value" } } )
84
83
. then ( ( response : { data : { [ k : string ] : string } } ) => {
@@ -90,10 +89,9 @@ describe("HTTP Transport Binding Emitter for CloudEvents", () => {
90
89
// A binary message will have a request body for the data
91
90
expect ( response . data . lunchBreak ) . to . equal ( data . lunchBreak ) ;
92
91
} )
93
- . catch ( expect . fail ) ;
94
- } ) ;
92
+ . catch ( expect . fail ) ) ;
95
93
96
- it ( "Sends a structured 1.0 CloudEvent if specified" , ( ) => {
94
+ it ( "Sends a structured 1.0 CloudEvent if specified" , ( ) =>
97
95
emitter
98
96
. send ( event , { protocol : Protocol . HTTPStructured } )
99
97
. then ( ( response : { data : { [ k : string ] : string | Record < string , string > ; data : { lunchBreak : string } } } ) => {
@@ -108,8 +106,7 @@ describe("HTTP Transport Binding Emitter for CloudEvents", () => {
108
106
expect ( response . data [ ext1Name ] ) . to . equal ( ext1Value ) ;
109
107
expect ( response . data [ ext2Name ] ) . to . equal ( ext2Value ) ;
110
108
} )
111
- . catch ( expect . fail ) ;
112
- } ) ;
109
+ . catch ( expect . fail ) ) ;
113
110
114
111
it ( "Sends to an alternate URL if specified" , ( ) => {
115
112
nock ( receiver )
@@ -124,7 +121,7 @@ describe("HTTP Transport Binding Emitter for CloudEvents", () => {
124
121
return [ 201 , returnBody ] ;
125
122
} ) ;
126
123
127
- emitter
124
+ return emitter
128
125
. send ( event , { protocol : Protocol . HTTPStructured , url : `${ receiver } alternate` } )
129
126
. then ( ( response : AxiosResponse ) => {
130
127
// A structured message will have a cloud event content type
@@ -152,7 +149,7 @@ describe("HTTP Transport Binding Emitter for CloudEvents", () => {
152
149
[ ext3Name ] : ext3Value ,
153
150
} ) ;
154
151
155
- it ( "Sends a binary 0.3 CloudEvent" , ( ) => {
152
+ it ( "Sends a binary 0.3 CloudEvent" , ( ) =>
156
153
emitter
157
154
. send ( event )
158
155
. then ( ( response : AxiosResponse ) => {
@@ -166,8 +163,7 @@ describe("HTTP Transport Binding Emitter for CloudEvents", () => {
166
163
expect ( response . data [ `${ CONSTANTS . EXTENSIONS_PREFIX } ${ ext2Name } ` ] ) . to . equal ( ext2Value ) ;
167
164
expect ( response . data [ `${ CONSTANTS . EXTENSIONS_PREFIX } ${ ext3Name } ` ] . value ) . to . equal ( ext3Value . value ) ;
168
165
} )
169
- . catch ( expect . fail ) ;
170
- } ) ;
166
+ . catch ( expect . fail ) ) ;
171
167
172
168
it ( "Provides the HTTP headers for a binary event" , ( ) => {
173
169
const headers = headersFor ( event ) ;
@@ -178,7 +174,7 @@ describe("HTTP Transport Binding Emitter for CloudEvents", () => {
178
174
expect ( headers [ CONSTANTS . CE_HEADERS . TIME ] ) . to . equal ( event . time ) ;
179
175
} ) ;
180
176
181
- it ( "Sends a structured 0.3 CloudEvent if specified" , ( ) => {
177
+ it ( "Sends a structured 0.3 CloudEvent if specified" , ( ) =>
182
178
emitter
183
179
. send ( event , { protocol : Protocol . HTTPStructured } )
184
180
. then (
@@ -197,8 +193,7 @@ describe("HTTP Transport Binding Emitter for CloudEvents", () => {
197
193
expect ( response . data [ ext2Name ] ) . to . equal ( ext2Value ) ;
198
194
} ,
199
195
)
200
- . catch ( expect . fail ) ;
201
- } ) ;
196
+ . catch ( expect . fail ) ) ;
202
197
203
198
it ( "Sends to an alternate URL if specified" , ( ) => {
204
199
nock ( receiver )
@@ -213,7 +208,7 @@ describe("HTTP Transport Binding Emitter for CloudEvents", () => {
213
208
return [ 201 , returnBody ] ;
214
209
} ) ;
215
210
216
- emitter
211
+ return emitter
217
212
. send ( event , { protocol : Protocol . HTTPStructured , url : `${ receiver } alternate` } )
218
213
. then (
219
214
( response : {
0 commit comments