Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cedced19 committed May 26, 2017
1 parent f994a07 commit 842f78b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 22 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { AppRegistry } from 'react-native';
import { StackNavigator } from 'react-navigation';
import MainScreen from './app/screens/main.js';

const DecouvrirPhalsbourg = StackNavigator({
export default DecouvrirPhalsbourg = StackNavigator({
Main: {screen: MainScreen}
}, {
navigationOptions: {
Expand Down
7 changes: 7 additions & 0 deletions jest/setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
jest.mock('Linking', () => ({
addEventListener: jest.fn(),
removeEventListener: jest.fn(),
openURL: jest.genMockFn().mockReturnValue(Promise.resolve()),
canOpenURL: jest.genMockFn().mockReturnValue(Promise.resolve()),
getInitialURL: jest.genMockFn().mockReturnValue(Promise.resolve()),
}))
47 changes: 26 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
{
"name": "DecouvrirPhalsbourg",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.0.0-alpha.6",
"react-native": "0.44.1"
},
"devDependencies": {
"babel-jest": "20.0.3",
"babel-preset-react-native": "1.9.2",
"jest": "20.0.4",
"react-test-renderer": "16.0.0-alpha.6"
},
"jest": {
"preset": "react-native"
}
}
"name": "DecouvrirPhalsbourg",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.0.0-alpha.6",
"react-native": "0.44.1",
"react-navigation": "^1.0.0-beta.11"
},
"devDependencies": {
"babel-jest": "20.0.3",
"babel-preset-react-native": "1.9.2",
"jest": "20.0.4",
"react-test-renderer": "16.0.0-alpha.6"
},
"jest": {
"preset": "react-native",
"setupFiles": ["./jest/setup.js"],
"transformIgnorePatterns": [
"node_modules/(?!(jest-)?react-native|react-navigation|react-clone-referenced-element)"
]
}
}

0 comments on commit 842f78b

Please sign in to comment.