From 398f1d8dddaa5f5c12909ab479e99c3e83c3b884 Mon Sep 17 00:00:00 2001 From: Eli White Date: Mon, 14 May 2018 00:09:36 -0700 Subject: [PATCH] vars -> let/const react-native IntegrationTests Reviewed By: yungsters Differential Revision: D7986752 fbshipit-source-id: 1f9b129ce19e052584a2cd1240686b6099c64416 --- IntegrationTests/AppEventsTest.js | 18 +++++----- IntegrationTests/AsyncStorageTest.js | 32 +++++++++--------- IntegrationTests/ImageCachePolicyTest.js | 8 ++--- IntegrationTests/ImageSnapshotTest.js | 8 ++--- .../IntegrationTestHarnessTest.js | 12 +++---- IntegrationTests/IntegrationTestsApp.js | 10 +++--- IntegrationTests/LayoutEventsTest.js | 24 +++++++------- IntegrationTests/LoggingTestModule.js | 8 ++--- IntegrationTests/PromiseTest.js | 8 ++--- IntegrationTests/PropertiesUpdateTest.js | 8 ++--- .../RCTRootViewIntegrationTestApp.js | 10 +++--- .../ReactContentSizeUpdateTest.js | 26 +++++++-------- IntegrationTests/SimpleSnapshotTest.js | 12 +++---- IntegrationTests/SizeFlexibilityUpdateTest.js | 22 ++++++------- IntegrationTests/SyncMethodTest.js | 6 ++-- IntegrationTests/TimersTest.js | 33 ++++++++++--------- IntegrationTests/WebSocketTest.js | 20 +++++------ IntegrationTests/WebViewTest.js | 18 +++++----- 18 files changed, 143 insertions(+), 140 deletions(-) diff --git a/IntegrationTests/AppEventsTest.js b/IntegrationTests/AppEventsTest.js index 9df430fea..90da0bd87 100644 --- a/IntegrationTests/AppEventsTest.js +++ b/IntegrationTests/AppEventsTest.js @@ -10,14 +10,14 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {NativeAppEventEmitter, StyleSheet, Text, View} = ReactNative; -var {TestModule} = ReactNative.NativeModules; +const React = require('react'); +const ReactNative = require('react-native'); +const {NativeAppEventEmitter, StyleSheet, Text, View} = ReactNative; +const {TestModule} = ReactNative.NativeModules; -var deepDiffer = require('deepDiffer'); +const deepDiffer = require('deepDiffer'); -var TEST_PAYLOAD = {foo: 'bar'}; +const TEST_PAYLOAD = {foo: 'bar'}; type AppEvent = {data: Object, ts: number}; type State = { @@ -31,7 +31,7 @@ class AppEventsTest extends React.Component<{}, State> { componentDidMount() { NativeAppEventEmitter.addListener('testEvent', this.receiveEvent); - var event = {data: TEST_PAYLOAD, ts: Date.now()}; + const event = {data: TEST_PAYLOAD, ts: Date.now()}; TestModule.sendAppEvent('testEvent', event); this.setState({sent: event}); } @@ -40,7 +40,7 @@ class AppEventsTest extends React.Component<{}, State> { if (deepDiffer(event.data, TEST_PAYLOAD)) { throw new Error('Received wrong event: ' + JSON.stringify(event)); } - var elapsed = Date.now() - event.ts + 'ms'; + const elapsed = Date.now() - event.ts + 'ms'; this.setState({received: event, elapsed}, () => { TestModule.markTestCompleted(); }); @@ -57,7 +57,7 @@ class AppEventsTest extends React.Component<{}, State> { AppEventsTest.displayName = 'AppEventsTest'; -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ container: { margin: 40, }, diff --git a/IntegrationTests/AsyncStorageTest.js b/IntegrationTests/AsyncStorageTest.js index 9245854e2..150aa2aed 100644 --- a/IntegrationTests/AsyncStorageTest.js +++ b/IntegrationTests/AsyncStorageTest.js @@ -10,27 +10,27 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {AsyncStorage, Text, View} = ReactNative; -var {TestModule} = ReactNative.NativeModules; +const React = require('react'); +const ReactNative = require('react-native'); +const {AsyncStorage, Text, View} = ReactNative; +const {TestModule} = ReactNative.NativeModules; -var deepDiffer = require('deepDiffer'); +const deepDiffer = require('deepDiffer'); -var DEBUG = false; +const DEBUG = false; -var KEY_1 = 'key_1'; -var VAL_1 = 'val_1'; -var KEY_2 = 'key_2'; -var VAL_2 = 'val_2'; -var KEY_MERGE = 'key_merge'; -var VAL_MERGE_1 = {foo: 1, bar: {hoo: 1, boo: 1}, moo: {a: 3}}; -var VAL_MERGE_2 = {bar: {hoo: 2}, baz: 2, moo: {a: 3}}; -var VAL_MERGE_EXPECT = {foo: 1, bar: {hoo: 2, boo: 1}, baz: 2, moo: {a: 3}}; +const KEY_1 = 'key_1'; +const VAL_1 = 'val_1'; +const KEY_2 = 'key_2'; +const VAL_2 = 'val_2'; +const KEY_MERGE = 'key_merge'; +const VAL_MERGE_1 = {foo: 1, bar: {hoo: 1, boo: 1}, moo: {a: 3}}; +const VAL_MERGE_2 = {bar: {hoo: 2}, baz: 2, moo: {a: 3}}; +const VAL_MERGE_EXPECT = {foo: 1, bar: {hoo: 2, boo: 1}, baz: 2, moo: {a: 3}}; // setup in componentDidMount -var done = (result: ?boolean) => {}; -var updateMessage = (message: string) => {}; +let done = (result: ?boolean) => {}; +let updateMessage = (message: string) => {}; function runTestCase(description: string, fn) { updateMessage(description); diff --git a/IntegrationTests/ImageCachePolicyTest.js b/IntegrationTests/ImageCachePolicyTest.js index 1c4429389..1dc5d5fb6 100644 --- a/IntegrationTests/ImageCachePolicyTest.js +++ b/IntegrationTests/ImageCachePolicyTest.js @@ -10,10 +10,10 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {Image, View, Text, StyleSheet} = ReactNative; -var {TestModule} = ReactNative.NativeModules; +const React = require('react'); +const ReactNative = require('react-native'); +const {Image, View, Text, StyleSheet} = ReactNative; +const {TestModule} = ReactNative.NativeModules; /* * The reload and force-cache tests don't actually verify that the complete functionality. diff --git a/IntegrationTests/ImageSnapshotTest.js b/IntegrationTests/ImageSnapshotTest.js index 5c74433a9..c20406c64 100644 --- a/IntegrationTests/ImageSnapshotTest.js +++ b/IntegrationTests/ImageSnapshotTest.js @@ -10,10 +10,10 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {Image, View} = ReactNative; -var {TestModule} = ReactNative.NativeModules; +const React = require('react'); +const ReactNative = require('react-native'); +const {Image, View} = ReactNative; +const {TestModule} = ReactNative.NativeModules; class ImageSnapshotTest extends React.Component<{}> { componentDidMount() { diff --git a/IntegrationTests/IntegrationTestHarnessTest.js b/IntegrationTests/IntegrationTestHarnessTest.js index 2a596d068..045d2e7e1 100644 --- a/IntegrationTests/IntegrationTestHarnessTest.js +++ b/IntegrationTests/IntegrationTestHarnessTest.js @@ -13,12 +13,12 @@ /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error * found when Flow v0.54 was deployed. To see the error delete this comment and * run Flow. */ -var requestAnimationFrame = require('fbjs/lib/requestAnimationFrame'); -var React = require('react'); -var PropTypes = require('prop-types'); -var ReactNative = require('react-native'); -var {Text, View} = ReactNative; -var {TestModule} = ReactNative.NativeModules; +const requestAnimationFrame = require('fbjs/lib/requestAnimationFrame'); +const React = require('react'); +const PropTypes = require('prop-types'); +const ReactNative = require('react-native'); +const {Text, View} = ReactNative; +const {TestModule} = ReactNative.NativeModules; class IntegrationTestHarnessTest extends React.Component< { diff --git a/IntegrationTests/IntegrationTestsApp.js b/IntegrationTests/IntegrationTestsApp.js index c59f15b3d..421b4f6ab 100644 --- a/IntegrationTests/IntegrationTestsApp.js +++ b/IntegrationTests/IntegrationTestsApp.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var { +const React = require('react'); +const ReactNative = require('react-native'); +const { AppRegistry, ScrollView, StyleSheet, @@ -22,7 +22,7 @@ var { } = ReactNative; // Keep this list in sync with RNTesterIntegrationTests.m -var TESTS = [ +const TESTS = [ require('./IntegrationTestHarnessTest'), require('./TimersTest'), require('./AsyncStorageTest'), @@ -89,7 +89,7 @@ class IntegrationTestsApp extends React.Component<{}, $FlowFixMeState> { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ container: { backgroundColor: 'white', marginTop: 40, diff --git a/IntegrationTests/LayoutEventsTest.js b/IntegrationTests/LayoutEventsTest.js index b9183a34e..5d2676bc1 100644 --- a/IntegrationTests/LayoutEventsTest.js +++ b/IntegrationTests/LayoutEventsTest.js @@ -10,13 +10,13 @@ 'use strict'; -var React = require('react'); -var createReactClass = require('create-react-class'); -var ReactNative = require('react-native'); -var {Image, LayoutAnimation, StyleSheet, Text, View} = ReactNative; -var {TestModule} = ReactNative.NativeModules; +const React = require('react'); +const createReactClass = require('create-react-class'); +const ReactNative = require('react-native'); +const {Image, LayoutAnimation, StyleSheet, Text, View} = ReactNative; +const {TestModule} = ReactNative.NativeModules; -var deepDiffer = require('deepDiffer'); +const deepDiffer = require('deepDiffer'); function debug(...args) { // console.log.apply(null, arguments); @@ -42,7 +42,7 @@ type State = { containerStyle?: Style, }; -var LayoutEventsTest = createReactClass({ +const LayoutEventsTest = createReactClass({ displayName: 'LayoutEventsTest', getInitialState(): State { return { @@ -93,7 +93,7 @@ var LayoutEventsTest = createReactClass({ }, compare: function(node: string, measured: any, onLayout: any): void { if (deepDiffer(measured, onLayout)) { - var data = {measured, onLayout}; + const data = {measured, onLayout}; throw new Error( node + ' onLayout mismatch with measure ' + @@ -114,9 +114,9 @@ var LayoutEventsTest = createReactClass({ this.setState({imageLayout: e.nativeEvent.layout}, this.checkLayout); }, render: function() { - var viewStyle = [styles.view, this.state.viewStyle]; - var textLayout = this.state.textLayout || {width: '?', height: '?'}; - var imageLayout = this.state.imageLayout || {x: '?', y: '?'}; + const viewStyle = [styles.view, this.state.viewStyle]; + const textLayout = this.state.textLayout || {width: '?', height: '?'}; + const imageLayout = this.state.imageLayout || {x: '?', y: '?'}; debug('viewLayout', this.state.viewLayout); return ( @@ -141,7 +141,7 @@ var LayoutEventsTest = createReactClass({ }, }); -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ container: { margin: 40, }, diff --git a/IntegrationTests/LoggingTestModule.js b/IntegrationTests/LoggingTestModule.js index 76a4fbccd..905abee40 100644 --- a/IntegrationTests/LoggingTestModule.js +++ b/IntegrationTests/LoggingTestModule.js @@ -9,12 +9,12 @@ 'use strict'; -var BatchedBridge = require('BatchedBridge'); +const BatchedBridge = require('BatchedBridge'); -var warning = require('fbjs/lib/warning'); -var invariant = require('fbjs/lib/invariant'); +const warning = require('fbjs/lib/warning'); +const invariant = require('fbjs/lib/invariant'); -var LoggingTestModule = { +const LoggingTestModule = { logToConsole: function(str) { console.log(str); }, diff --git a/IntegrationTests/PromiseTest.js b/IntegrationTests/PromiseTest.js index 3e919a867..facf8b45c 100644 --- a/IntegrationTests/PromiseTest.js +++ b/IntegrationTests/PromiseTest.js @@ -10,10 +10,10 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {View} = ReactNative; -var {TestModule} = ReactNative.NativeModules; +const React = require('react'); +const ReactNative = require('react-native'); +const {View} = ReactNative; +const {TestModule} = ReactNative.NativeModules; class PromiseTest extends React.Component<{}> { shouldResolve = false; diff --git a/IntegrationTests/PropertiesUpdateTest.js b/IntegrationTests/PropertiesUpdateTest.js index e2c16f3a6..33d17da5e 100644 --- a/IntegrationTests/PropertiesUpdateTest.js +++ b/IntegrationTests/PropertiesUpdateTest.js @@ -9,11 +9,11 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {View} = ReactNative; -var {TestModule} = ReactNative.NativeModules; +const {TestModule} = ReactNative.NativeModules; class PropertiesUpdateTest extends React.Component { render() { diff --git a/IntegrationTests/RCTRootViewIntegrationTestApp.js b/IntegrationTests/RCTRootViewIntegrationTestApp.js index 8cb499f36..6afda59cd 100644 --- a/IntegrationTests/RCTRootViewIntegrationTestApp.js +++ b/IntegrationTests/RCTRootViewIntegrationTestApp.js @@ -11,10 +11,10 @@ require('regenerator-runtime/runtime'); -var React = require('react'); -var ReactNative = require('react-native'); +const React = require('react'); +const ReactNative = require('react-native'); -var { +const { AppRegistry, ScrollView, StyleSheet, @@ -24,7 +24,7 @@ var { } = ReactNative; /* Keep this list in sync with RCTRootViewIntegrationTests.m */ -var TESTS = [ +const TESTS = [ require('./PropertiesUpdateTest'), require('./ReactContentSizeUpdateTest'), require('./SizeFlexibilityUpdateTest'), @@ -70,7 +70,7 @@ class RCTRootViewIntegrationTestApp extends React.Component { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ container: { backgroundColor: 'white', marginTop: 40, diff --git a/IntegrationTests/ReactContentSizeUpdateTest.js b/IntegrationTests/ReactContentSizeUpdateTest.js index 1306f8d7a..be0b06b6a 100644 --- a/IntegrationTests/ReactContentSizeUpdateTest.js +++ b/IntegrationTests/ReactContentSizeUpdateTest.js @@ -9,23 +9,23 @@ 'use strict'; -var React = require('react'); -var createReactClass = require('create-react-class'); -var ReactNative = require('react-native'); -var RCTNativeAppEventEmitter = require('RCTNativeAppEventEmitter'); -var Subscribable = require('Subscribable'); -var TimerMixin = require('react-timer-mixin'); +const React = require('react'); +const createReactClass = require('create-react-class'); +const ReactNative = require('react-native'); +const RCTNativeAppEventEmitter = require('RCTNativeAppEventEmitter'); +const Subscribable = require('Subscribable'); +const TimerMixin = require('react-timer-mixin'); -var {View} = ReactNative; +const {View} = ReactNative; -var {TestModule} = ReactNative.NativeModules; +const {TestModule} = ReactNative.NativeModules; -var reactViewWidth = 101; -var reactViewHeight = 102; -var newReactViewWidth = 201; -var newReactViewHeight = 202; +const reactViewWidth = 101; +const reactViewHeight = 102; +const newReactViewWidth = 201; +const newReactViewHeight = 202; -var ReactContentSizeUpdateTest = createReactClass({ +const ReactContentSizeUpdateTest = createReactClass({ displayName: 'ReactContentSizeUpdateTest', mixins: [Subscribable.Mixin, TimerMixin], diff --git a/IntegrationTests/SimpleSnapshotTest.js b/IntegrationTests/SimpleSnapshotTest.js index ea32c4a9a..2857f3f41 100644 --- a/IntegrationTests/SimpleSnapshotTest.js +++ b/IntegrationTests/SimpleSnapshotTest.js @@ -10,15 +10,15 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); +const React = require('react'); +const ReactNative = require('react-native'); /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error * found when Flow v0.54 was deployed. To see the error delete this comment and * run Flow. */ -var requestAnimationFrame = require('fbjs/lib/requestAnimationFrame'); +const requestAnimationFrame = require('fbjs/lib/requestAnimationFrame'); -var {StyleSheet, View} = ReactNative; -var {TestModule} = ReactNative.NativeModules; +const {StyleSheet, View} = ReactNative; +const {TestModule} = ReactNative.NativeModules; class SimpleSnapshotTest extends React.Component<{}> { componentDidMount() { @@ -42,7 +42,7 @@ class SimpleSnapshotTest extends React.Component<{}> { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ box1: { width: 80, height: 50, diff --git a/IntegrationTests/SizeFlexibilityUpdateTest.js b/IntegrationTests/SizeFlexibilityUpdateTest.js index 5f885ddb7..0d0ebd4bf 100644 --- a/IntegrationTests/SizeFlexibilityUpdateTest.js +++ b/IntegrationTests/SizeFlexibilityUpdateTest.js @@ -9,21 +9,21 @@ 'use strict'; -var React = require('react'); -var createReactClass = require('create-react-class'); -var ReactNative = require('react-native'); -var RCTNativeAppEventEmitter = require('RCTNativeAppEventEmitter'); -var Subscribable = require('Subscribable'); -var {View} = ReactNative; +const React = require('react'); +const createReactClass = require('create-react-class'); +const ReactNative = require('react-native'); +const RCTNativeAppEventEmitter = require('RCTNativeAppEventEmitter'); +const Subscribable = require('Subscribable'); +const {View} = ReactNative; -var {TestModule} = ReactNative.NativeModules; +const {TestModule} = ReactNative.NativeModules; -var reactViewWidth = 111; -var reactViewHeight = 222; +const reactViewWidth = 111; +const reactViewHeight = 222; -var finalState = false; +let finalState = false; -var SizeFlexibilityUpdateTest = createReactClass({ +const SizeFlexibilityUpdateTest = createReactClass({ displayName: 'SizeFlexibilityUpdateTest', mixins: [Subscribable.Mixin], diff --git a/IntegrationTests/SyncMethodTest.js b/IntegrationTests/SyncMethodTest.js index eca1df986..6efef977d 100644 --- a/IntegrationTests/SyncMethodTest.js +++ b/IntegrationTests/SyncMethodTest.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {View} = ReactNative; const {TestModule, RNTesterTestModule} = ReactNative.NativeModules; diff --git a/IntegrationTests/TimersTest.js b/IntegrationTests/TimersTest.js index 86e1a9621..15d42c4c8 100644 --- a/IntegrationTests/TimersTest.js +++ b/IntegrationTests/TimersTest.js @@ -10,18 +10,18 @@ 'use strict'; -var React = require('react'); -var createReactClass = require('create-react-class'); -var ReactNative = require('react-native'); +const React = require('react'); +const createReactClass = require('create-react-class'); +const ReactNative = require('react-native'); /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error * found when Flow v0.54 was deployed. To see the error delete this comment and * run Flow. */ -var TimerMixin = require('react-timer-mixin'); +const TimerMixin = require('react-timer-mixin'); -var {StyleSheet, Text, View} = ReactNative; -var {TestModule} = ReactNative.NativeModules; +const {StyleSheet, Text, View} = ReactNative; +const {TestModule} = ReactNative.NativeModules; -var TimersTest = createReactClass({ +const TimersTest = createReactClass({ displayName: 'TimersTest', mixins: [TimerMixin], @@ -70,22 +70,25 @@ var TimersTest = createReactClass({ }, testClearTimeout0() { - var timeout = this.setTimeout(() => this._fail('testClearTimeout0'), 0); + const timeout = this.setTimeout(() => this._fail('testClearTimeout0'), 0); this.clearTimeout(timeout); this.testClearTimeout30(); }, testClearTimeout30() { - var timeout = this.setTimeout(() => this._fail('testClearTimeout30'), 30); + const timeout = this.setTimeout(() => this._fail('testClearTimeout30'), 30); this.clearTimeout(timeout); this.setTimeout(this.testClearMulti, 50); }, testClearMulti() { - var fails = []; + const fails = []; fails.push(this.setTimeout(() => this._fail('testClearMulti-1'), 20)); fails.push(this.setTimeout(() => this._fail('testClearMulti-2'), 50)); - var delayClear = this.setTimeout(() => this._fail('testClearMulti-3'), 50); + const delayClear = this.setTimeout( + () => this._fail('testClearMulti-3'), + 50, + ); fails.push(this.setTimeout(() => this._fail('testClearMulti-4'), 0)); fails.push(this.setTimeout(() => this._fail('testClearMulti-5'), 10)); @@ -97,7 +100,7 @@ var TimersTest = createReactClass({ testOrdering() { // Clear timers are set first because it's more likely to uncover bugs. - var fail0; + let fail0; this.setImmediate(() => this.clearTimeout(fail0)); fail0 = this.setTimeout( () => @@ -107,7 +110,7 @@ var TimersTest = createReactClass({ ), 0, ); - var failAnim; // This should fail without the t=0 fastpath feature. + let failAnim; // This should fail without the t=0 fastpath feature. this.setTimeout(() => this.cancelAnimationFrame(failAnim), 0); failAnim = this.requestAnimationFrame(() => this._fail( @@ -115,7 +118,7 @@ var TimersTest = createReactClass({ 'requestAnimationFrame', ), ); - var fail25; + let fail25; this.setTimeout(() => { this.clearTimeout(fail25); }, 20); @@ -165,7 +168,7 @@ var TimersTest = createReactClass({ }, }); -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ container: { backgroundColor: 'white', padding: 40, diff --git a/IntegrationTests/WebSocketTest.js b/IntegrationTests/WebSocketTest.js index 33d6b2500..f2478cbcb 100644 --- a/IntegrationTests/WebSocketTest.js +++ b/IntegrationTests/WebSocketTest.js @@ -10,10 +10,10 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {View} = ReactNative; -var {TestModule} = ReactNative.NativeModules; +const React = require('react'); +const ReactNative = require('react-native'); +const {View} = ReactNative; +const {TestModule} = ReactNative.NativeModules; const DEFAULT_WS_URL = 'ws://localhost:5555/'; @@ -49,9 +49,9 @@ class WebSocketTest extends React.Component<{}, State> { }; _waitFor = (condition: any, timeout: any, callback: any) => { - var remaining = timeout; - var t; - var timeoutFunction = function() { + let remaining = timeout; + let t; + const timeoutFunction = function() { if (condition()) { callback(true); return; @@ -121,7 +121,7 @@ class WebSocketTest extends React.Component<{}, State> { } testConnect = () => { - var component = this; + const component = this; component._connect(); component._waitFor(component._socketIsConnected, 5, function( connectSucceeded, @@ -135,7 +135,7 @@ class WebSocketTest extends React.Component<{}, State> { }; testSendAndReceive = () => { - var component = this; + const component = this; component._sendTestMessage(); component._waitFor(component._receivedTestExpectedResponse, 5, function( messageReceived, @@ -149,7 +149,7 @@ class WebSocketTest extends React.Component<{}, State> { }; testDisconnect = () => { - var component = this; + const component = this; component._disconnect(); component._waitFor(component._socketIsDisconnected, 5, function( disconnectSucceeded, diff --git a/IntegrationTests/WebViewTest.js b/IntegrationTests/WebViewTest.js index 47b4544cd..74dbeddec 100644 --- a/IntegrationTests/WebViewTest.js +++ b/IntegrationTests/WebViewTest.js @@ -9,18 +9,18 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {WebView} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {WebView} = ReactNative; -var {TestModule} = ReactNative.NativeModules; +const {TestModule} = ReactNative.NativeModules; class WebViewTest extends React.Component { render() { - var firstMessageReceived = false; - var secondMessageReceived = false; + let firstMessageReceived = false; + let secondMessageReceived = false; function processMessage(e) { - var message = e.nativeEvent.data; + const message = e.nativeEvent.data; if (message === 'First') { firstMessageReceived = true; } @@ -41,7 +41,7 @@ class WebViewTest extends React.Component { throw new Error('First message got lost'); } } - var html = + const html = 'Hello world' + '