Update to 14.0
Reviewed By: kassens Differential Revision: D3627753 fbshipit-source-id: 35b8246c8cb61e60908d8c233a6e72063bf67096
This commit is contained in:
parent
7971cca4f0
commit
75ecaf4190
|
@ -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;
|
|
@ -9,11 +9,6 @@
|
||||||
|
|
||||||
jest.disableAutomock();
|
jest.disableAutomock();
|
||||||
|
|
||||||
jest.mock('NativeModules')
|
|
||||||
.mock('Text')
|
|
||||||
.mock('ensureComponentIsNative')
|
|
||||||
.mock('View');
|
|
||||||
|
|
||||||
const React = require('React');
|
const React = require('React');
|
||||||
const ReactTestRenderer = require('react/lib/ReactTestRenderer');
|
const ReactTestRenderer = require('react/lib/ReactTestRenderer');
|
||||||
const Text = require('Text');
|
const Text = require('Text');
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
exports[`TouchableHighlight renders correctly 0`] = `
|
exports[`TouchableHighlight renders correctly 1`] = `
|
||||||
<View
|
<View
|
||||||
accessibilityComponentType={undefined}
|
accessibilityComponentType={undefined}
|
||||||
accessibilityLabel={undefined}
|
accessibilityLabel={undefined}
|
||||||
|
@ -14,7 +14,9 @@ exports[`TouchableHighlight renders correctly 0`] = `
|
||||||
onStartShouldSetResponder={[Function bound touchableHandleStartShouldSetResponder]}
|
onStartShouldSetResponder={[Function bound touchableHandleStartShouldSetResponder]}
|
||||||
style={
|
style={
|
||||||
Array [
|
Array [
|
||||||
4,
|
Object {
|
||||||
|
"backgroundColor": "transparent"
|
||||||
|
},
|
||||||
Object {}
|
Object {}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,11 +12,14 @@
|
||||||
const React = require('React');
|
const React = require('React');
|
||||||
const {Component} = React;
|
const {Component} = React;
|
||||||
|
|
||||||
|
const RealText = require.requireActual('Text');
|
||||||
|
|
||||||
class Text extends Component {
|
class Text extends Component {
|
||||||
render() {
|
render() {
|
||||||
const {children, ...props} = this.props;
|
const {children, ...props} = this.props;
|
||||||
return React.createElement('Text', props, children);
|
return React.createElement('Text', props, children);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Text.propTypes = RealText.propTypes;
|
||||||
|
|
||||||
module.exports = Text;
|
module.exports = Text;
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
require.requireActual('../packager/react-packager/src/Resolver/polyfills/babelHelpers.js');
|
require.requireActual('../packager/react-packager/src/Resolver/polyfills/babelHelpers.js');
|
||||||
|
require.requireActual('../packager/react-packager/src/Resolver/polyfills/Object.es7.js');
|
||||||
|
|
||||||
global.__DEV__ = true;
|
global.__DEV__ = true;
|
||||||
global.__fbBatchedBridgeConfig = {
|
global.__fbBatchedBridgeConfig = {
|
||||||
|
@ -19,4 +20,17 @@ global.__fbBatchedBridgeConfig = {
|
||||||
global.Promise = require('promise');
|
global.Promise = require('promise');
|
||||||
global.regeneratorRuntime = require.requireActual('regenerator-runtime/runtime');
|
global.regeneratorRuntime = require.requireActual('regenerator-runtime/runtime');
|
||||||
|
|
||||||
|
jest
|
||||||
|
.mock('ensureComponentIsNative')
|
||||||
|
.mock('Image')
|
||||||
|
.mock('NativeModules')
|
||||||
|
.mock('Text')
|
||||||
|
.mock('View');
|
||||||
|
|
||||||
|
const mockEmptyObject = {};
|
||||||
|
jest.mock('ReactNativePropRegistry', () => ({
|
||||||
|
register: id => id,
|
||||||
|
getByID: () => mockEmptyObject,
|
||||||
|
}));
|
||||||
|
|
||||||
jest.setMock('ErrorUtils', require('ErrorUtils'));
|
jest.setMock('ErrorUtils', require('ErrorUtils'));
|
||||||
|
|
10
package.json
10
package.json
|
@ -25,6 +25,7 @@
|
||||||
"defaultPlatform": "ios",
|
"defaultPlatform": "ios",
|
||||||
"providesModuleNodeModules": [
|
"providesModuleNodeModules": [
|
||||||
"react-native",
|
"react-native",
|
||||||
|
"react",
|
||||||
"parse"
|
"parse"
|
||||||
],
|
],
|
||||||
"platforms": [
|
"platforms": [
|
||||||
|
@ -33,6 +34,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"modulePathIgnorePatterns": [
|
"modulePathIgnorePatterns": [
|
||||||
|
"Libraries/react-native/",
|
||||||
"/node_modules/(?!react|fbjs|react-native|parse|react-transform-hmr|core-js|promise)/",
|
"/node_modules/(?!react|fbjs|react-native|parse|react-transform-hmr|core-js|promise)/",
|
||||||
"node_modules/react/node_modules/fbjs/",
|
"node_modules/react/node_modules/fbjs/",
|
||||||
"node_modules/react/lib/ReactDOM.js",
|
"node_modules/react/lib/ReactDOM.js",
|
||||||
|
@ -113,7 +115,7 @@
|
||||||
"flow"
|
"flow"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "NODE_ENV=test jest",
|
"test": "jest",
|
||||||
"flow": "flow",
|
"flow": "flow",
|
||||||
"lint": "eslint Examples/ Libraries/",
|
"lint": "eslint Examples/ Libraries/",
|
||||||
"start": "/usr/bin/env bash -c './packager/packager.sh \"$@\" || true' --"
|
"start": "/usr/bin/env bash -c './packager/packager.sh \"$@\" || true' --"
|
||||||
|
@ -199,9 +201,9 @@
|
||||||
"eslint-plugin-flow-vars": "^0.2.1",
|
"eslint-plugin-flow-vars": "^0.2.1",
|
||||||
"eslint-plugin-react": "^4.2.1",
|
"eslint-plugin-react": "^4.2.1",
|
||||||
"flow-bin": "^0.29.0",
|
"flow-bin": "^0.29.0",
|
||||||
"jest": "^13.1.0",
|
"jest": "latest",
|
||||||
"jest-repl": "^13.1.0",
|
"jest-repl": "latest",
|
||||||
"jest-runtime": "^13.1.0",
|
"jest-runtime": "latest",
|
||||||
"portfinder": "0.4.0",
|
"portfinder": "0.4.0",
|
||||||
"react": "~15.3.0-rc.2",
|
"react": "~15.3.0-rc.2",
|
||||||
"shelljs": "0.6.0"
|
"shelljs": "0.6.0"
|
||||||
|
|
|
@ -174,7 +174,7 @@ describe('Bundler', function() {
|
||||||
{runMainModule: true, runBeforeMainModule: []}
|
{runMainModule: true, runBeforeMainModule: []}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
expect(bundle.addAsset.mock.calls).toContain([{
|
expect(bundle.addAsset.mock.calls[0]).toEqual([{
|
||||||
__packager_asset: true,
|
__packager_asset: true,
|
||||||
path: '/root/img/img.png',
|
path: '/root/img/img.png',
|
||||||
uri: 'img',
|
uri: 'img',
|
||||||
|
@ -183,7 +183,7 @@ describe('Bundler', function() {
|
||||||
deprecated: true,
|
deprecated: true,
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
expect(bundle.addAsset.mock.calls).toContain([{
|
expect(bundle.addAsset.mock.calls[1]).toEqual([{
|
||||||
__packager_asset: true,
|
__packager_asset: true,
|
||||||
fileSystemLocation: '/root/img',
|
fileSystemLocation: '/root/img',
|
||||||
httpServerLocation: '/assets/img',
|
httpServerLocation: '/assets/img',
|
||||||
|
|
Loading…
Reference in New Issue