Skip to content

Commit

Permalink
Add testing capability
Browse files Browse the repository at this point in the history
  • Loading branch information
wyne committed Aug 11, 2023
1 parent e0bd112 commit d69cad1
Show file tree
Hide file tree
Showing 10 changed files with 7,336 additions and 2,927 deletions.
1 change: 1 addition & 0 deletions __mocks__/@react-native-async-storage/async-storage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default from '@react-native-async-storage/async-storage/jest/async-storage-mock';
5 changes: 4 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
presets: [
'babel-preset-expo',
'@babel/preset-typescript'
],
plugins: ['react-native-reanimated/plugin'],
};
};
14 changes: 14 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
preset: 'jest-expo',
transform: {
'^.+\\.tsx?$': 'babel-jest',
},
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)"
],
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
setupFilesAfterEnv: [
"@testing-library/jest-native/extend-expect"
]
};
Loading

0 comments on commit d69cad1

Please sign in to comment.