Skip to content

Commit

Permalink
test: add extra test case
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Sep 29, 2022
1 parent 77555af commit 37985f4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,22 @@ describe('getMetricsForFamily', () => {
`)
// Test cache
expect(await getMetricsForFamily('Merriweather Sans')).toEqual(metrics)

expect(
generateFontFace(metrics!, {
name: 'Merriweather Sans override',
fallbacks: ['Arial'],
})
).toMatchInlineSnapshot(`
"@font-face {
font-family: \\"Merriweather Sans override\\";
src: local(\\"Arial\\");
ascent-override: 98.4%;
descent-override: 27.3%;
line-gap-override: 0%;
}
"
`)
})

it('handles non-existent metrics', async () => {
Expand Down

0 comments on commit 37985f4

Please sign in to comment.