Skip to content

Commit

Permalink
Fix test so it doesn't break if the hash of a subset font changes (it…
Browse files Browse the repository at this point in the history
… probably changes because of the recent harfbuzzjs update)
  • Loading branch information
papandreou committed May 13, 2021
1 parent 85949a4 commit 3188b3d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/subsetFonts.js
Expand Up @@ -3670,14 +3670,14 @@ describe('subsetFonts', function () {
});
await subsetFonts(assetGraph);
expect(
indexHtml.text,
indexHtml.text.replace(/-[a-f0-9]{10}\./g, '-xxxxxxxxxx.'),
'to contain',
`<script>try{new FontFace('Alice__subset',"url('"+'/subfont/Alice-400-f5827e52ee.woff2'.toString('url')+"') format('woff2'),url('"+'/subfont/Alice-400-3b35760549.woff'.toString('url')+"') format('woff')",{}).load()}catch(e){}</script>`
`<script>try{new FontFace('Alice__subset',"url('"+'/subfont/Alice-400-xxxxxxxxxx.woff2'.toString('url')+"') format('woff2'),url('"+'/subfont/Alice-400-xxxxxxxxxx.woff'.toString('url')+"') format('woff')",{}).load()}catch(e){}</script>`
);
expect(
aboutHtml.text,
aboutHtml.text.replace(/-[a-f0-9]{10}\./g, '-xxxxxxxxxx.'),
'to contain',
`<script>try{new FontFace('Font Awesome 5 Free__subset',"url('"+'/subfont/Font_Awesome_5_Free-400-ecf46ce47c.woff2'.toString('url')+"') format('woff2'),url('"+'/subfont/Font_Awesome_5_Free-400-0b82ebfc0a.woff'.toString('url')+"') format('woff')",{}).load()}catch(e){}</script>`
`<script>try{new FontFace('Font Awesome 5 Free__subset',"url('"+'/subfont/Font_Awesome_5_Free-400-xxxxxxxxxx.woff2'.toString('url')+"') format('woff2'),url('"+'/subfont/Font_Awesome_5_Free-400-xxxxxxxxxx.woff'.toString('url')+"') format('woff')",{}).load()}catch(e){}</script>`
);
});

Expand Down

0 comments on commit 3188b3d

Please sign in to comment.