@@ -103,7 +103,6 @@ describe('Dev rewrite, trailing slash -> never, with base', () => {
103
103
await devServer . stop ( ) ;
104
104
} ) ;
105
105
106
-
107
106
it ( 'should rewrite to the homepage' , async ( ) => {
108
107
const html = await fixture . fetch ( '/base/foo' ) . then ( ( res ) => res . text ( ) ) ;
109
108
const $ = cheerioLoad ( html ) ;
@@ -208,7 +207,7 @@ describe('Dev rewrite URL contains base and has no trailing slash', () => {
208
207
before ( async ( ) => {
209
208
fixture = await loadFixture ( {
210
209
root : './fixtures/rewrite-with-base/' ,
211
- trailingSlash : 'never'
210
+ trailingSlash : 'never' ,
212
211
} ) ;
213
212
devServer = await fixture . startDevServer ( ) ;
214
213
} ) ;
@@ -217,40 +216,40 @@ describe('Dev rewrite URL contains base and has no trailing slash', () => {
217
216
await devServer . stop ( ) ;
218
217
} ) ;
219
218
220
- it ( " should rewrite to homepage & url contains base" , async ( ) => {
221
- const html = await fixture . fetch ( '/base/rewrite-to-index' ) . then ( res => res . text ( ) )
222
- const $ = cheerioLoad ( html )
219
+ it ( ' should rewrite to homepage & url contains base' , async ( ) => {
220
+ const html = await fixture . fetch ( '/base/rewrite-to-index' ) . then ( ( res ) => res . text ( ) ) ;
221
+ const $ = cheerioLoad ( html ) ;
223
222
224
223
assert . equal ( $ ( 'h1' ) . text ( ) , 'Index' ) ;
225
224
assert . equal ( $ ( 'p' ) . text ( ) , '/base' ) ;
226
- } )
225
+ } ) ;
227
226
228
- it ( " should rewrite to homepage & url contains base when base is in the rewrite call" , async ( ) => {
229
- const html = await fixture . fetch ( '/base/rewrite-with-base-to-index' ) . then ( res => res . text ( ) )
230
- const $ = cheerioLoad ( html )
227
+ it ( ' should rewrite to homepage & url contains base when base is in the rewrite call' , async ( ) => {
228
+ const html = await fixture . fetch ( '/base/rewrite-with-base-to-index' ) . then ( ( res ) => res . text ( ) ) ;
229
+ const $ = cheerioLoad ( html ) ;
231
230
232
231
assert . equal ( $ ( 'h1' ) . text ( ) , 'Index' ) ;
233
232
assert . equal ( $ ( 'p' ) . text ( ) , '/base' ) ;
234
- } )
233
+ } ) ;
235
234
236
- it ( " should rewrite to subpage & url contains base" , async ( ) => {
237
- const html = await fixture . fetch ( '/base/rewrite-to-subpage' ) . then ( res => res . text ( ) )
238
- const $ = cheerioLoad ( html )
235
+ it ( ' should rewrite to subpage & url contains base' , async ( ) => {
236
+ const html = await fixture . fetch ( '/base/rewrite-to-subpage' ) . then ( ( res ) => res . text ( ) ) ;
237
+ const $ = cheerioLoad ( html ) ;
239
238
240
239
assert . equal ( $ ( 'h1' ) . text ( ) , 'Page' ) ;
241
240
assert . equal ( $ ( 'p' ) . text ( ) , '/base/page' ) ;
242
- } )
243
-
241
+ } ) ;
244
242
245
- it ( "should rewrite to page & url contains base when base is in the rewrite call" , async ( ) => {
246
- const html = await fixture . fetch ( '/base/rewrite-with-base-to-subpage' ) . then ( res => res . text ( ) )
247
- const $ = cheerioLoad ( html )
243
+ it ( 'should rewrite to page & url contains base when base is in the rewrite call' , async ( ) => {
244
+ const html = await fixture
245
+ . fetch ( '/base/rewrite-with-base-to-subpage' )
246
+ . then ( ( res ) => res . text ( ) ) ;
247
+ const $ = cheerioLoad ( html ) ;
248
248
249
249
assert . equal ( $ ( 'h1' ) . text ( ) , 'Page' ) ;
250
250
assert . equal ( $ ( 'p' ) . text ( ) , '/base/page' ) ;
251
- } )
252
-
253
- } )
251
+ } ) ;
252
+ } ) ;
254
253
describe ( 'Dev rewrite URL contains base and has trailing slash' , ( ) => {
255
254
/** @type {import('./test-utils').Fixture } */
256
255
let fixture ;
@@ -259,7 +258,7 @@ describe('Dev rewrite URL contains base and has trailing slash', () => {
259
258
before ( async ( ) => {
260
259
fixture = await loadFixture ( {
261
260
root : './fixtures/rewrite-with-base/' ,
262
- trailingSlash : 'always'
261
+ trailingSlash : 'always' ,
263
262
} ) ;
264
263
devServer = await fixture . startDevServer ( ) ;
265
264
} ) ;
@@ -268,33 +267,36 @@ describe('Dev rewrite URL contains base and has trailing slash', () => {
268
267
await devServer . stop ( ) ;
269
268
} ) ;
270
269
271
- it ( "should rewrite to homepage & url contains base when base is in the rewrite call" , async ( ) => {
272
- const html = await fixture . fetch ( '/base/rewrite-with-base-to-index-with-slash/' ) . then ( res => res . text ( ) )
273
- const $ = cheerioLoad ( html )
270
+ it ( 'should rewrite to homepage & url contains base when base is in the rewrite call' , async ( ) => {
271
+ const html = await fixture
272
+ . fetch ( '/base/rewrite-with-base-to-index-with-slash/' )
273
+ . then ( ( res ) => res . text ( ) ) ;
274
+ const $ = cheerioLoad ( html ) ;
274
275
275
276
assert . equal ( $ ( 'h1' ) . text ( ) , 'Index' ) ;
276
277
assert . equal ( $ ( 'p' ) . text ( ) , '/base/' ) ;
277
- } )
278
+ } ) ;
278
279
279
- it ( "should rewrite to subpage & url contains base" , async ( ) => {
280
- const html = await fixture . fetch ( '/base/rewrite-to-subpage-with-slash/' ) . then ( res => res . text ( ) )
281
- const $ = cheerioLoad ( html )
280
+ it ( 'should rewrite to subpage & url contains base' , async ( ) => {
281
+ const html = await fixture
282
+ . fetch ( '/base/rewrite-to-subpage-with-slash/' )
283
+ . then ( ( res ) => res . text ( ) ) ;
284
+ const $ = cheerioLoad ( html ) ;
282
285
283
286
assert . equal ( $ ( 'h1' ) . text ( ) , 'Page' ) ;
284
287
assert . equal ( $ ( 'p' ) . text ( ) , '/base/page/' ) ;
285
- } )
286
-
288
+ } ) ;
287
289
288
- it ( "should rewrite to page & url contains base when base is in the rewrite call" , async ( ) => {
289
- const html = await fixture . fetch ( '/base/rewrite-with-base-to-subpage-with-slash/' ) . then ( res => res . text ( ) )
290
- const $ = cheerioLoad ( html )
290
+ it ( 'should rewrite to page & url contains base when base is in the rewrite call' , async ( ) => {
291
+ const html = await fixture
292
+ . fetch ( '/base/rewrite-with-base-to-subpage-with-slash/' )
293
+ . then ( ( res ) => res . text ( ) ) ;
294
+ const $ = cheerioLoad ( html ) ;
291
295
292
296
assert . equal ( $ ( 'h1' ) . text ( ) , 'Page' ) ;
293
297
assert . equal ( $ ( 'p' ) . text ( ) , '/base/page/' ) ;
294
- } )
295
-
296
- } )
297
-
298
+ } ) ;
299
+ } ) ;
298
300
299
301
describe ( 'Build reroute' , ( ) => {
300
302
/** @type {import('./test-utils').Fixture } */
0 commit comments