-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: rename typescale to font for consistency
- Loading branch information
1 parent
2a31919
commit c939b5c
Showing
17 changed files
with
101 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import configureFonts, { fontConfig } from '../fonts'; | ||
|
||
const mockPlatform = (OS) => { | ||
jest.resetModules(); | ||
jest.doMock('react-native/Libraries/Utilities/Platform', () => ({ | ||
OS, | ||
select: (objs) => objs[OS], | ||
})); | ||
}; | ||
|
||
const customFont = { | ||
custom: { | ||
fontFamily: 'sans-serif', | ||
fontWeight: 'bold', | ||
}, | ||
}; | ||
|
||
describe('configureFonts', () => { | ||
it('adds custom fonts to the iOS config', () => { | ||
mockPlatform('ios'); | ||
expect( | ||
configureFonts({ | ||
ios: { | ||
...fontConfig.ios, | ||
customFont, | ||
}, | ||
}) | ||
).toEqual({ | ||
...fontConfig.ios, | ||
customFont, | ||
}); | ||
}); | ||
|
||
it('adds custom fonts to the Android config', () => { | ||
mockPlatform('android'); | ||
expect( | ||
configureFonts({ | ||
android: { | ||
...fontConfig.android, | ||
customFont, | ||
}, | ||
}) | ||
).toEqual({ | ||
...fontConfig.android, | ||
customFont, | ||
}); | ||
}); | ||
|
||
it('adds custom fonts to the Web config', () => { | ||
mockPlatform('web'); | ||
expect( | ||
configureFonts({ | ||
web: { | ||
...fontConfig.web, | ||
customFont, | ||
}, | ||
}) | ||
).toEqual({ | ||
...fontConfig.web, | ||
customFont, | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters