Skip to content

Commit

Permalink
test: update tests of generator function
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Oct 31, 2022
1 parent 7f1d967 commit a17c58d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ describe('parseFontFace', () => {
url("/fonts/OpenSans-Regular-webfont.woff") format("woff");
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
}`
)
).next().value
expect(result).toMatchInlineSnapshot(`
{
"family": "Roboto",
Expand All @@ -157,28 +157,30 @@ describe('parseFontFace', () => {
`)
})
it('should handle incomplete font-faces', () => {
const result = parseFontFace(
for (const result of parseFontFace(
`@font-face {
}`
)
expect(result).toMatchInlineSnapshot(`
)) {
expect(result).toMatchInlineSnapshot(`
{
"family": "",
"source": "",
}
`)
}
})
it('should handle sources without urls', () => {
const result = parseFontFace(
for (const result of parseFontFace(
`@font-face {
src: local("Arial") url();
}`
)
expect(result).toMatchInlineSnapshot(`
)) {
expect(result).toMatchInlineSnapshot(`
{
"family": "",
"source": "",
}
`)
`)
}
})
})

0 comments on commit a17c58d

Please sign in to comment.