@@ -1066,9 +1066,9 @@ describe('rollup-plugin-html', () => {
1066
1066
const bundle = await rollup ( config ) ;
1067
1067
const { output } = await bundle . generate ( outputConfig ) ;
1068
1068
1069
- const fontNormal = output . find ( o => o . name === 'font-normal.woff2' ) ;
1070
- const fontBold = output . find ( o => o . name === 'font-normal.woff2' ) ;
1071
- const style = output . find ( o => o . name === 'styles-with-fonts.css' ) ;
1069
+ const fontNormal = output . find ( o => o . name ?. endsWith ( 'font-normal.woff2' ) ) ;
1070
+ const fontBold = output . find ( o => o . name ?. endsWith ( 'font-normal.woff2' ) ) ;
1071
+ const style = output . find ( o => o . name ?. endsWith ( 'styles-with-fonts.css' ) ) ;
1072
1072
// It has emitted the font
1073
1073
expect ( fontBold ) . to . exist ;
1074
1074
expect ( fontNormal ) . to . exist ;
@@ -1106,8 +1106,8 @@ describe('rollup-plugin-html', () => {
1106
1106
const bundle = await rollup ( config ) ;
1107
1107
const { output } = await bundle . generate ( outputConfig ) ;
1108
1108
1109
- const font = output . find ( o => o . name === 'font-normal.woff2' ) ;
1110
- const style = output . find ( o => o . name === 'node_modules-styles-with-fonts.css' ) ;
1109
+ const font = output . find ( o => o . name ?. endsWith ( 'font-normal.woff2' ) ) ;
1110
+ const style = output . find ( o => o . name ?. endsWith ( 'node_modules-styles-with-fonts.css' ) ) ;
1111
1111
1112
1112
// It has emitted the font
1113
1113
expect ( font ) . to . exist ;
@@ -1146,7 +1146,7 @@ describe('rollup-plugin-html', () => {
1146
1146
const bundle = await rollup ( config ) ;
1147
1147
const { output } = await bundle . generate ( outputConfig ) ;
1148
1148
1149
- const fonts = output . filter ( o => o . name === 'font-normal.woff2' ) ;
1149
+ const fonts = output . filter ( o => o . name ?. endsWith ( 'font-normal.woff2' ) ) ;
1150
1150
expect ( fonts . length ) . to . equal ( 1 ) ;
1151
1151
} ) ;
1152
1152
@@ -1174,13 +1174,13 @@ describe('rollup-plugin-html', () => {
1174
1174
const bundle = await rollup ( config ) ;
1175
1175
const { output } = await bundle . generate ( outputConfig ) ;
1176
1176
1177
- expect ( output . find ( o => o . name === 'star.avif' ) ) . to . exist ;
1178
- expect ( output . find ( o => o . name === 'star.gif' ) ) . to . exist ;
1179
- expect ( output . find ( o => o . name === 'star.jpeg' ) ) . to . exist ;
1180
- expect ( output . find ( o => o . name === 'star.jpg' ) ) . to . exist ;
1181
- expect ( output . find ( o => o . name === 'star.png' ) ) . to . exist ;
1182
- expect ( output . find ( o => o . name === 'star.svg' ) ) . to . exist ;
1183
- expect ( output . find ( o => o . name === 'star.webp' ) ) . to . exist ;
1177
+ expect ( output . find ( o => o . name ?. endsWith ( 'star.avif' ) ) ) . to . exist ;
1178
+ expect ( output . find ( o => o . name ?. endsWith ( 'star.gif' ) ) ) . to . exist ;
1179
+ expect ( output . find ( o => o . name ?. endsWith ( 'star.jpeg' ) ) ) . to . exist ;
1180
+ expect ( output . find ( o => o . name ?. endsWith ( 'star.jpg' ) ) ) . to . exist ;
1181
+ expect ( output . find ( o => o . name ?. endsWith ( 'star.png' ) ) ) . to . exist ;
1182
+ expect ( output . find ( o => o . name ?. endsWith ( 'star.svg' ) ) ) . to . exist ;
1183
+ expect ( output . find ( o => o . name ?. endsWith ( 'star.webp' ) ) ) . to . exist ;
1184
1184
1185
1185
const rewrittenCss = ( output . find ( o => o . name === 'styles.css' ) as OutputAsset ) . source
1186
1186
. toString ( )
0 commit comments