Skip to content

Commit

Permalink
feat(converter): added convert and checkplatform function
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKicw committed Oct 5, 2021
1 parent ab3b58a commit a0bc74a
Show file tree
Hide file tree
Showing 7 changed files with 309 additions and 161 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"glob-all": "^3.2.1",
"husky": "^4.2.5",
"jest": "^26.0.1",
"jest-react-native": "^18.0.0",
"pod-install": "^0.1.0",
"prettier": "^2.0.5",
"react": "16.13.1",
Expand All @@ -80,6 +81,7 @@
"react-native": "*"
},
"jest": {
"preset": "react-native",
"modulePathIgnorePatterns": [
"<rootDir>/example/node_modules",
"<rootDir>/lib/",
Expand Down Expand Up @@ -132,8 +134,7 @@
"useTabs": false,
"semi": false
}
],
"react-native/no-inline-styles": "off"
]
}
},
"eslintIgnore": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { convert, checkPlatform } from '../convert'

const mock = jest.fn(() => 'android')

jest.mock('react-native', () => ({
Platform: {
get OS() {
Expand All @@ -19,8 +20,9 @@ test('checkPortal advanced ios ', () => {
)
).toStrictEqual([
{
platforms: { ios: true, android: false, web: false },
platforms: { ios: true, android: false, web: false ,macos:false,windows:false},
media: null,
dark:false,
style: {
backgroundColor: 'rgba(59, 130, 246, 1)',
color: 'rgba(255, 255, 255, 1)',
Expand All @@ -29,6 +31,7 @@ test('checkPortal advanced ios ', () => {
{
platforms: null,
media: null,
dark:false,
style: {
paddingBottom: 32,
paddingLeft: 32,
Expand All @@ -43,7 +46,8 @@ test('checkPortal basic android', () => {
mock.mockImplementation(() => 'android')
expect(checkPlatform(convert('android:pt-8 ios:pt-16'))).toStrictEqual([
{
platforms: { ios: false, android: true, web: false },
platforms: { ios: false, android: true, web: false ,macos:false,windows:false},
dark:false,
media: null,
style: { paddingTop: 32 },
},
Expand All @@ -54,8 +58,9 @@ test('checkPortal basic ios', () => {
mock.mockImplementation(() => 'ios')
expect(checkPlatform(convert('android:pt-8 ios:pt-16'))).toStrictEqual([
{
platforms: { ios: true, android: false, web: false },
platforms: { ios: true, android: false, web: false ,macos:false,windows:false},
media: null,
dark:false,
style: { paddingTop: 64 },
},
])
Expand Down
155 changes: 0 additions & 155 deletions src/__tests__/convert.test.js

This file was deleted.

Loading

0 comments on commit a0bc74a

Please sign in to comment.