diff --git a/Libraries/Components/Touchable/__mocks__/ensureComponentIsNative.js b/Libraries/Components/Touchable/__mocks__/ensureComponentIsNative.js new file mode 100644 index 000000000..e537f2be0 --- /dev/null +++ b/Libraries/Components/Touchable/__mocks__/ensureComponentIsNative.js @@ -0,0 +1,11 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ +'use strict'; + +module.exports = () => true; diff --git a/Libraries/Components/Touchable/__tests__/TouchableHighlight-test.js b/Libraries/Components/Touchable/__tests__/TouchableHighlight-test.js index 597484c4f..5a46044e4 100644 --- a/Libraries/Components/Touchable/__tests__/TouchableHighlight-test.js +++ b/Libraries/Components/Touchable/__tests__/TouchableHighlight-test.js @@ -9,11 +9,6 @@ jest.disableAutomock(); -jest.mock('NativeModules') - .mock('Text') - .mock('ensureComponentIsNative') - .mock('View'); - const React = require('React'); const ReactTestRenderer = require('react/lib/ReactTestRenderer'); const Text = require('Text'); diff --git a/Libraries/Components/Touchable/__tests__/__snapshots__/TouchableHighlight-test.js.snap b/Libraries/Components/Touchable/__tests__/__snapshots__/TouchableHighlight-test.js.snap index 09fc682ea..eb6648902 100644 --- a/Libraries/Components/Touchable/__tests__/__snapshots__/TouchableHighlight-test.js.snap +++ b/Libraries/Components/Touchable/__tests__/__snapshots__/TouchableHighlight-test.js.snap @@ -1,4 +1,4 @@ -exports[`TouchableHighlight renders correctly 0`] = ` +exports[`TouchableHighlight renders correctly 1`] = ` ({ + register: id => id, + getByID: () => mockEmptyObject, +})); + jest.setMock('ErrorUtils', require('ErrorUtils')); diff --git a/package.json b/package.json index b34eda1f7..85ea4ed7c 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "defaultPlatform": "ios", "providesModuleNodeModules": [ "react-native", + "react", "parse" ], "platforms": [ @@ -33,6 +34,7 @@ ] }, "modulePathIgnorePatterns": [ + "Libraries/react-native/", "/node_modules/(?!react|fbjs|react-native|parse|react-transform-hmr|core-js|promise)/", "node_modules/react/node_modules/fbjs/", "node_modules/react/lib/ReactDOM.js", @@ -113,7 +115,7 @@ "flow" ], "scripts": { - "test": "NODE_ENV=test jest", + "test": "jest", "flow": "flow", "lint": "eslint Examples/ Libraries/", "start": "/usr/bin/env bash -c './packager/packager.sh \"$@\" || true' --" @@ -199,9 +201,9 @@ "eslint-plugin-flow-vars": "^0.2.1", "eslint-plugin-react": "^4.2.1", "flow-bin": "^0.29.0", - "jest": "^13.1.0", - "jest-repl": "^13.1.0", - "jest-runtime": "^13.1.0", + "jest": "latest", + "jest-repl": "latest", + "jest-runtime": "latest", "portfinder": "0.4.0", "react": "~15.3.0-rc.2", "shelljs": "0.6.0" diff --git a/packager/react-packager/src/Bundler/__tests__/Bundler-test.js b/packager/react-packager/src/Bundler/__tests__/Bundler-test.js index 33cca0548..eef2dab56 100644 --- a/packager/react-packager/src/Bundler/__tests__/Bundler-test.js +++ b/packager/react-packager/src/Bundler/__tests__/Bundler-test.js @@ -174,7 +174,7 @@ describe('Bundler', function() { {runMainModule: true, runBeforeMainModule: []} ]); - expect(bundle.addAsset.mock.calls).toContain([{ + expect(bundle.addAsset.mock.calls[0]).toEqual([{ __packager_asset: true, path: '/root/img/img.png', uri: 'img', @@ -183,7 +183,7 @@ describe('Bundler', function() { deprecated: true, }]); - expect(bundle.addAsset.mock.calls).toContain([{ + expect(bundle.addAsset.mock.calls[1]).toEqual([{ __packager_asset: true, fileSystemLocation: '/root/img', httpServerLocation: '/assets/img',