File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -393,6 +393,7 @@ export class ApiResponse extends Macroable {
393393 * has the expected value
394394 */
395395 assertHeader ( name : string , value ?: any ) {
396+ name = name . toLowerCase ( )
396397 this . #ensureHasAssert( )
397398 this . assert ! . property ( this . headers ( ) , name )
398399
@@ -405,6 +406,7 @@ export class ApiResponse extends Macroable {
405406 * Assert response to not contain a given header
406407 */
407408 assertHeaderMissing ( name : string ) {
409+ name = name . toLowerCase ( )
408410 this . #ensureHasAssert( )
409411 this . assert ! . notProperty ( this . headers ( ) , name )
410412 }
Original file line number Diff line number Diff line change @@ -104,11 +104,12 @@ test.group('Response | assertions', (group) => {
104104 } )
105105
106106 test ( 'assert response headers' , async ( { assert } ) => {
107- assert . plan ( 2 )
107+ assert . plan ( 5 )
108108
109109 httpServer . onRequest ( ( _ , res ) => {
110110 res . statusCode = 200
111111 res . setHeader ( 'content-type' , 'text/plain' )
112+ res . setHeader ( 'Access-Control-Allow-Origin' , '*' )
112113 res . end ( 'hello world' )
113114 } )
114115
@@ -119,6 +120,9 @@ test.group('Response | assertions', (group) => {
119120
120121 const response = await request
121122 response . assertHeader ( 'content-type' )
123+ response . assertHeader ( 'Content-Type' )
124+ response . assertHeader ( 'access-control-allow-origin' )
125+ response . assertHeader ( 'Access-Control-Allow-Origin' )
122126 response . assertHeaderMissing ( 'authorization' )
123127 } )
124128
You can’t perform that action at this time.
0 commit comments