-
Notifications
You must be signed in to change notification settings - Fork 410
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from obytes/tests
Tests
- Loading branch information
Showing
11 changed files
with
2,045 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
singleQuote: true, | ||
endOfLine: 'auto', | ||
}; |
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,42 @@ | ||
import React from 'react'; | ||
import { FlatList, Modal, ScrollView, View } from 'react-native'; | ||
|
||
const BottomSheetModalContext = React.createContext(null); | ||
|
||
const BottomSheetModalProvider = (props: any) => { | ||
return <BottomSheetModalContext.Provider {...props} value={{}} />; | ||
}; | ||
const BottomSheet = (props: any) => <View {...props} />; | ||
const BottomSheetModal = (props: any) => <Modal {...props} />; | ||
|
||
const BottomSheetBackdrop = (props: any) => <View {...props} />; | ||
const BottomSheetHandle = (props: any) => <View {...props} />; | ||
const BottomSheetFooter = (props: any) => <View {...props} />; | ||
const BottomSheetScrollView = (props: any) => <ScrollView {...props} />; | ||
const BottomSheetFlatList = (props: any) => <FlatList {...props} />; | ||
|
||
const useBottomSheet = jest.fn(); | ||
const useBottomSheetModal = jest.fn(); | ||
const useBottomSheetSpringConfigs = jest.fn(); | ||
const useBottomSheetTimingConfigs = jest.fn(); | ||
const useBottomSheetInternal = jest.fn(); | ||
const useBottomSheetDynamicSnapPoints = jest.fn(); | ||
|
||
export { useBottomSheet }; | ||
export { useBottomSheetModal }; | ||
export { useBottomSheetSpringConfigs }; | ||
export { useBottomSheetTimingConfigs }; | ||
export { useBottomSheetInternal }; | ||
export { useBottomSheetDynamicSnapPoints }; | ||
|
||
export { | ||
BottomSheetBackdrop, | ||
BottomSheetFlatList, | ||
BottomSheetFooter, | ||
BottomSheetHandle, | ||
BottomSheetModal, | ||
BottomSheetModalProvider, | ||
BottomSheetScrollView, | ||
}; | ||
|
||
export default BottomSheet; |
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,25 @@ | ||
import { FlatList, ScrollView, TouchableOpacity, View } from 'react-native'; | ||
|
||
module.exports = { | ||
ScrollView, | ||
FlatList, | ||
TouchableOpacity, | ||
PanGestureHandler: View, | ||
attachGestureHandler: () => {}, | ||
createGestureHandler: () => {}, | ||
dropGestureHandler: () => {}, | ||
updateGestureHandler: () => {}, | ||
Direction: { | ||
RIGHT: 1, | ||
LEFT: 2, | ||
UP: 4, | ||
DOWN: 8, | ||
}, | ||
State: { | ||
BEGAN: 'BEGAN', | ||
FAILED: 'FAILED', | ||
ACTIVE: 'ACTIVE', | ||
END: 'END', | ||
UNDETERMINED: 'UNDETERMINED', | ||
}, | ||
}; |
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 @@ | ||
module.exports = require('react-native-reanimated/mock'); |
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,31 @@ | ||
module.exports = { | ||
testEnvironment: 'jsdom', | ||
preset: 'jest-expo', | ||
globals: { | ||
'ts-jest': { | ||
tsconfig: { | ||
jsx: 'react', | ||
}, | ||
}, | ||
}, | ||
transform: { | ||
'^.+\\.js$': '<rootDir>/node_modules/react-native/jest/preprocessor.js', | ||
'^.+\\.tsx?$': 'ts-jest', | ||
}, | ||
testMatch: ['**/?(*.)+(spec|test).ts?(x)'], | ||
collectCoverageFrom: [ | ||
'**/*.{ts,tsx}', | ||
'!**/coverage/**', | ||
'!**/node_modules/**', | ||
'!**/babel.config.js', | ||
'!**/jest.setup.js', | ||
], | ||
moduleFileExtensions: ['js', 'ts', 'tsx'], | ||
transformIgnorePatterns: [ | ||
'node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg)', | ||
], | ||
coverageReporters: ['json-summary', 'text', 'lcov'], | ||
moduleNameMapper: { | ||
'^@/(.*)$': '<rootDir>/src/$1', | ||
}, | ||
}; |
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,20 @@ | ||
//App.spec.tsx | ||
import { cleanup, render, screen } from '@testing-library/react-native'; | ||
import React from 'react'; | ||
|
||
import { Login } from './index'; | ||
|
||
afterEach(cleanup); | ||
|
||
test('LoginComponents', () => { | ||
render(<Login />); | ||
const { getByTestId } = screen; | ||
|
||
const emailInput = getByTestId('emailInput'); | ||
const passwordInput = getByTestId('passwordInput'); | ||
const LoginButton = getByTestId('LoginButton'); | ||
|
||
expect(emailInput).toBeDefined(); | ||
expect(passwordInput).toBeDefined(); | ||
expect(LoginButton).toBeDefined(); | ||
}); |
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
"paths": { | ||
"@/*": ["./src/*"], | ||
"@config": ["./config/index.ts"] | ||
} | ||
}, | ||
"esModuleInterop": true | ||
} | ||
} |
Oops, something went wrong.