Skip to content

Commit 4c40ee7

Browse files
committed
update to pass existing tests
1 parent e286d99 commit 4c40ee7

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`Generating sources source should return valid font sources with empty aliases 1`] = `"url('font.woff') format('woff'), url('font.ttf') format('truetype')"`;
3+
exports[`Generating font sources should return valid font sources with empty aliases 1`] = `"url('font.woff') format('woff'),url('font.ttf') format('truetype')"`;
44

5-
exports[`Generating sources source should return valid font sources with empty files 1`] = `"local('Times New Roman'), local('Calibri')"`;
5+
exports[`Generating font sources should return valid font sources with empty files 1`] = `"local('Times New Roman'),local('Calibri')"`;
66

7-
exports[`Generating sources source should return valid font sources with local aliases 1`] = `"local('Times New Roman'), local('Calibri'), url('font.woff') format('woff'), url('font.ttf') format('truetype')"`;
7+
exports[`Generating font sources should return valid font sources with local aliases 1`] = `"local('Times New Roman'),local('Calibri'),url('font.woff') format('woff'),url('font.ttf') format('truetype')"`;

packages/fela/src/__tests__/createRenderer-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ describe('Renderer', () => {
209209
const key = family + JSON.stringify(properties)
210210
const src = renderer.cache[key].fontFace.match(/.*(src:.*);.*$/)[1]
211211
expect(src).toEqual(
212-
"src:url('../fonts/Arial.ttf') format('truetype'), url('../fonts/Arial.woff') format('woff')"
212+
"src:url('../fonts/Arial.ttf') format('truetype'),url('../fonts/Arial.woff') format('woff')"
213213
)
214214
})
215215
})

packages/fela/src/generateFontSource.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function generateFontSource(
1111
const localSource = arrayReduce(
1212
fontLocals,
1313
(src, local, index) => {
14-
const prefix = index > 0 ? ', ' : ''
14+
const prefix = index > 0 ? ',' : ''
1515
const localUrl = getFontUrl(local)
1616

1717
return `${src}${prefix}local(${localUrl})`
@@ -21,15 +21,15 @@ export default function generateFontSource(
2121
const urlSource = arrayReduce(
2222
files,
2323
(src, fileSource, index) => {
24-
const prefix = index > 0 ? ', ' : ''
24+
const prefix = index > 0 ? ',' : ''
2525
const fileFormat = getFontFormat(fileSource)
2626
const fileUrl = getFontUrl(fileSource)
2727

2828
return `${src}${prefix}url(${fileUrl}) format('${fileFormat}')`
2929
},
3030
''
3131
)
32-
const delimiter = localSource.length > 0 && urlSource.length > 0 ? ', ' : ''
32+
const delimiter = localSource.length > 0 && urlSource.length > 0 ? ',' : ''
3333

3434
return `${localSource}${delimiter}${urlSource}`
3535
}

0 commit comments

Comments
 (0)