File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -191,6 +191,14 @@ suite('sendNotification', function() {
191
191
assert . equal ( requestDetails . headers . authorization , 'key=my_gcm_key' , 'Check GCM Authorization header' ) ;
192
192
}
193
193
}
194
+
195
+ const extraHeaders = options . extraOptions && options . extraOptions . headers ;
196
+ if ( extraHeaders ) {
197
+ Object . keys ( extraHeaders ) . forEach ( function ( header ) {
198
+ const normalizedName = header . toLowerCase ( ) ;
199
+ assert . equal ( requestDetails . headers [ normalizedName ] , extraHeaders [ header ] , 'Check presence of header ' + header ) ;
200
+ } ) ;
201
+ }
194
202
}
195
203
196
204
const validRequests = [
@@ -284,6 +292,19 @@ suite('sendNotification', function() {
284
292
TTL : 5
285
293
}
286
294
}
295
+ } , {
296
+ testTitle : 'send/receive extra headers' ,
297
+ requestOptions : {
298
+ subscription : {
299
+ // The default endpoint will be added by the test
300
+ } ,
301
+ extraOptions : {
302
+ headers : {
303
+ Extra : 'extra' ,
304
+ 'extra-2' : 'extra-2'
305
+ }
306
+ }
307
+ }
287
308
}
288
309
] ;
289
310
You can’t perform that action at this time.
0 commit comments