@@ -64,7 +64,7 @@ test('css import from js', async () => {
64
64
test ( 'css import asset with space' , async ( ) => {
65
65
const importedWithSpace = await page . $ ( '.import-with-space' )
66
66
67
- expect ( await getBg ( importedWithSpace ) ) . toMatch ( / .* o k \. . * p n g / )
67
+ expect ( await getBg ( importedWithSpace ) ) . toMatch ( / .* \/ o k . * \. p n g / )
68
68
} )
69
69
70
70
test ( 'postcss config' , async ( ) => {
@@ -90,7 +90,7 @@ test('sass', async () => {
90
90
isBuild ? / b a s e 6 4 / : '/nested/icon.png'
91
91
)
92
92
expect ( await getBg ( urlStartsWithVariable ) ) . toMatch (
93
- isBuild ? / o k \. \w + \. p n g / : `${ viteTestUrl } /ok.png`
93
+ isBuild ? / o k - \w + \. p n g / : `${ viteTestUrl } /ok.png`
94
94
)
95
95
expect ( await getColor ( partialImport ) ) . toBe ( 'orchid' )
96
96
@@ -124,7 +124,7 @@ test('less', async () => {
124
124
isBuild ? / b a s e 6 4 / : '/nested/icon.png'
125
125
)
126
126
expect ( await getBg ( urlStartsWithVariable ) ) . toMatch (
127
- isBuild ? / o k \. \w + \. p n g / : `${ viteTestUrl } /ok.png`
127
+ isBuild ? / o k - \w + \. p n g / : `${ viteTestUrl } /ok.png`
128
128
)
129
129
130
130
editFile ( 'less.less' , ( code ) => code . replace ( '@color: blue' , '@color: red' ) )
@@ -297,8 +297,8 @@ test('async chunk', async () => {
297
297
if ( isBuild ) {
298
298
// assert that the css is extracted into its own file instead of in the
299
299
// main css file
300
- expect ( findAssetFile ( / i n d e x \. \w + \. c s s $ / ) ) . not . toMatch ( 'teal' )
301
- expect ( findAssetFile ( / a s y n c \. \w + \. c s s $ / ) ) . toMatch ( '.async{color:teal}' )
300
+ expect ( findAssetFile ( / i n d e x - \w + \. c s s $ / ) ) . not . toMatch ( 'teal' )
301
+ expect ( findAssetFile ( / a s y n c - \w + \. c s s $ / ) ) . toMatch ( '.async{color:teal}' )
302
302
} else {
303
303
// test hmr
304
304
editFile ( 'async.css' , ( code ) => code . replace ( 'color: teal' , 'color: blue' ) )
@@ -316,8 +316,8 @@ test('treeshaken async chunk', async () => {
316
316
) . toBeNull ( )
317
317
// assert that the css is not present anywhere
318
318
expect ( findAssetFile ( / \. c s s $ / ) ) . not . toMatch ( 'plum' )
319
- expect ( findAssetFile ( / i n d e x \. \w + \. j s $ / ) ) . not . toMatch ( '.async{color:plum}' )
320
- expect ( findAssetFile ( / a s y n c \. \w + \. j s $ / ) ) . not . toMatch ( '.async{color:plum}' )
319
+ expect ( findAssetFile ( / i n d e x - \w + \. j s $ / ) ) . not . toMatch ( '.async{color:plum}' )
320
+ expect ( findAssetFile ( / a s y n c - \w + \. j s $ / ) ) . not . toMatch ( '.async{color:plum}' )
321
321
// should have no chunk!
322
322
expect ( findAssetFile ( / a s y n c - t r e e s h a k e n / ) ) . toBe ( '' )
323
323
} else {
@@ -416,7 +416,7 @@ test('minify css', async () => {
416
416
}
417
417
418
418
// should keep the rgba() syntax
419
- const cssFile = findAssetFile ( / i n d e x \. \w + \. c s s $ / )
419
+ const cssFile = findAssetFile ( / i n d e x - \w + \. c s s $ / )
420
420
expect ( cssFile ) . toMatch ( 'rgba(' )
421
421
expect ( cssFile ) . not . toMatch ( '#ffff00b3' )
422
422
} )
0 commit comments