This repository was archived by the owner on Jan 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
next-app/cypress/integration Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ describe("Pages Tests", () => {
18
18
( method ) => {
19
19
it ( `allows HTTP method for path ${ path } : ${ method } ` , ( ) => {
20
20
cy . request ( { url : path , method : method } ) . then ( ( response ) => {
21
+ if ( method !== "HEAD" ) {
22
+ cy . verifyResponseIsCompressed ( response ) ;
23
+ }
21
24
expect ( response . status ) . to . equal ( 200 ) ;
22
25
} ) ;
23
26
} ) ;
@@ -46,6 +49,9 @@ describe("Pages Tests", () => {
46
49
( method ) => {
47
50
it ( `allows HTTP method for path ${ path } : ${ method } ` , ( ) => {
48
51
cy . request ( { url : path , method : method } ) . then ( ( response ) => {
52
+ if ( method !== "HEAD" ) {
53
+ cy . verifyResponseIsCompressed ( response ) ;
54
+ }
49
55
expect ( response . status ) . to . equal ( 200 ) ;
50
56
} ) ;
51
57
} ) ;
Original file line number Diff line number Diff line change @@ -44,6 +44,9 @@ declare namespace Cypress {
44
44
response : Cypress . Response ,
45
45
shouldBeCached : boolean
46
46
) => Cypress . Chainable < JQuery > ;
47
+ verifyResponseIsCompressed : (
48
+ response : Cypress . Response
49
+ ) => Cypress . Chainable < JQuery > ;
47
50
}
48
51
}
49
52
@@ -140,3 +143,10 @@ Cypress.Commands.add(
140
143
}
141
144
}
142
145
) ;
146
+
147
+ Cypress . Commands . add (
148
+ "verifyResponseIsCompressed" ,
149
+ ( response : Cypress . Response ) => {
150
+ expect ( response . headers [ "content-encoding" ] ) . to . equal ( "gzip" ) ;
151
+ }
152
+ ) ;
You can’t perform that action at this time.
0 commit comments