@@ -6,15 +6,10 @@ import { nextTestSetup, FileRef } from 'e2e-utils'
6
6
import type { Response } from 'node-fetch'
7
7
8
8
describe ( 'app-dir with middleware' , ( ) => {
9
- const { next, skipped } = nextTestSetup ( {
9
+ const { next } = nextTestSetup ( {
10
10
files : __dirname ,
11
- skipDeployment : true ,
12
11
} )
13
12
14
- if ( skipped ) {
15
- return
16
- }
17
-
18
13
it ( 'should filter correctly after middleware rewrite' , async ( ) => {
19
14
const browser = await next . browser ( '/start' )
20
15
@@ -179,8 +174,10 @@ describe('app-dir with middleware', () => {
179
174
180
175
await browser . elementById ( 'submit-server-action' ) . click ( )
181
176
182
- await retry ( ( ) => {
183
- expect ( next . cliOutput ) . toMatch ( / \[ C o o k i e F r o m A c t i o n \] : \d + \. \d + / )
177
+ await retry ( async ( ) => {
178
+ expect ( await browser . elementById ( 'action-result' ) . text ( ) ) . toMatch (
179
+ / A c t i o n R e s u l t : \d + \. \d + /
180
+ )
184
181
} )
185
182
186
183
// ensure that we still can't read the secure cookie
@@ -210,16 +207,18 @@ describe('app-dir with middleware', () => {
210
207
211
208
await browser . elementById ( 'submit-server-action' ) . click ( )
212
209
213
- await retry ( ( ) => {
214
- expect ( next . cliOutput ) . toMatch ( / \[ C o o k i e F r o m A c t i o n \] : \d + \. \d + / )
210
+ await retry ( async ( ) => {
211
+ expect ( await browser . elementById ( 'action-result' ) . text ( ) ) . toMatch (
212
+ / A c t i o n R e s u l t : \d + \. \d + /
213
+ )
215
214
} )
216
215
217
216
await browser . deleteCookies ( )
218
217
} )
219
218
} )
220
219
221
220
describe ( 'app dir - middleware without pages dir' , ( ) => {
222
- const { next, skipped } = nextTestSetup ( {
221
+ const { next } = nextTestSetup ( {
223
222
files : {
224
223
app : new FileRef ( path . join ( __dirname , 'app' ) ) ,
225
224
'next.config.js' : new FileRef ( path . join ( __dirname , 'next.config.js' ) ) ,
@@ -235,13 +234,8 @@ describe('app dir - middleware without pages dir', () => {
235
234
}
236
235
` ,
237
236
} ,
238
- skipDeployment : true ,
239
237
} )
240
238
241
- if ( skipped ) {
242
- return
243
- }
244
-
245
239
// eslint-disable-next-line jest/no-identical-title
246
240
it ( 'Updates headers' , async ( ) => {
247
241
const html = await next . render ( '/headers' )
@@ -251,7 +245,7 @@ describe('app dir - middleware without pages dir', () => {
251
245
} )
252
246
253
247
describe ( 'app dir - middleware with middleware in src dir' , ( ) => {
254
- const { next, skipped } = nextTestSetup ( {
248
+ const { next } = nextTestSetup ( {
255
249
files : {
256
250
'src/app' : new FileRef ( path . join ( __dirname , 'app' ) ) ,
257
251
'next.config.js' : new FileRef ( path . join ( __dirname , 'next.config.js' ) ) ,
@@ -265,13 +259,8 @@ describe('app dir - middleware with middleware in src dir', () => {
265
259
}
266
260
` ,
267
261
} ,
268
- skipDeployment : true ,
269
262
} )
270
263
271
- if ( skipped ) {
272
- return
273
- }
274
-
275
264
it ( 'works without crashing when using requestAsyncStorage' , async ( ) => {
276
265
const browser = await next . browser ( '/' )
277
266
await browser . addCookie ( {
0 commit comments