diff --git a/index.js b/index.js index bf59d12..bd189ce 100644 --- a/index.js +++ b/index.js @@ -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: { diff --git a/jest/setup.js b/jest/setup.js new file mode 100644 index 0000000..fa49dca --- /dev/null +++ b/jest/setup.js @@ -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()), +})) diff --git a/package.json b/package.json index 996609f..8e641ec 100644 --- a/package.json +++ b/package.json @@ -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" - } -} \ No newline at end of file + "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)" + ] + } +}