File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
test/integration/image-optimizer/test Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1427,9 +1427,12 @@ export function runTests(ctx: RunTestsCtx) {
1427
1427
1428
1428
it ( 'should set cache-control to immutable for static images' , async ( ) => {
1429
1429
if ( ! ctx . isDev ) {
1430
- const filename = 'test'
1430
+ const filename = fs
1431
+ . readdirSync ( join ( ctx . appDir , '.next/static/media' ) )
1432
+ . find ( ( f ) => / ^ t e s t \. [ 0 - 9 a - f ] + \. j p g $ / . test ( f ) )
1433
+ expect ( filename ) . toBeString ( )
1431
1434
const query = {
1432
- url : `/_next/static/media/${ filename } .fab2915d.jpg ` ,
1435
+ url : `/_next/static/media/${ filename } ` ,
1433
1436
w : ctx . w ,
1434
1437
q : 100 ,
1435
1438
}
@@ -1442,7 +1445,7 @@ export function runTests(ctx: RunTestsCtx) {
1442
1445
)
1443
1446
expect ( res1 . headers . get ( 'Vary' ) ) . toBe ( 'Accept' )
1444
1447
expect ( res1 . headers . get ( 'Content-Disposition' ) ) . toBe (
1445
- `${ contentDispositionType } ; filename="${ filename } .webp"`
1448
+ `${ contentDispositionType } ; filename="test .webp"`
1446
1449
)
1447
1450
await expectWidth ( res1 , ctx . w )
1448
1451
@@ -1454,7 +1457,7 @@ export function runTests(ctx: RunTestsCtx) {
1454
1457
)
1455
1458
expect ( res2 . headers . get ( 'Vary' ) ) . toBe ( 'Accept' )
1456
1459
expect ( res2 . headers . get ( 'Content-Disposition' ) ) . toBe (
1457
- `${ contentDispositionType } ; filename="${ filename } .webp"`
1460
+ `${ contentDispositionType } ; filename="test .webp"`
1458
1461
)
1459
1462
await expectWidth ( res2 , ctx . w )
1460
1463
}
You can’t perform that action at this time.
0 commit comments