diff --git a/ReactAndroid/src/androidTest/js/ImageOverlayColorTestApp.js b/ReactAndroid/src/androidTest/js/ImageOverlayColorTestApp.js index 0d0c9b5e8..2461983ba 100644 --- a/ReactAndroid/src/androidTest/js/ImageOverlayColorTestApp.js +++ b/ReactAndroid/src/androidTest/js/ImageOverlayColorTestApp.js @@ -1,5 +1,5 @@ /** - * Copyright (c) 2013-present, Facebook, Inc. + * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. diff --git a/local-cli/runIOS/__tests__/findMatchingSimulator-test.js b/local-cli/runIOS/__tests__/findMatchingSimulator-test.js index f49b16c47..8b9a19552 100644 --- a/local-cli/runIOS/__tests__/findMatchingSimulator-test.js +++ b/local-cli/runIOS/__tests__/findMatchingSimulator-test.js @@ -540,136 +540,142 @@ describe('findMatchingSimulator', () => { }); it('should return the simulator with the specified version (multi ios versions)', () => { - expect(findMatchingSimulator({ - 'devices': { - 'iOS 9.2': [ - { - 'state': 'Shutdown', - 'availability': '(unavailable, runtime profile not found)', - 'name': 'iPhone 4s', - 'udid': 'B9B5E161-416B-43C4-A78F-729CB96CC8C6' - }, - { - 'state': 'Shutdown', - 'availability': '(available)', - 'name': 'iPhone 5', - 'udid': '1CCBBF8B-5773-4EA6-BD6F-C308C87A1ADB' - }, - { - 'state': 'Shutdown', - 'availability': '(available)', - 'name': 'iPhone 6', - 'udid': 'BA0D93BD-07E6-4182-9B0A-F60A2474139C' - }, - { - 'state': 'Shutdown', - 'availability': '(available)', - 'name': 'iPhone 6 (Plus)', - 'udid': '9564ABEE-9EC2-4B4A-B443-D3710929A45A' - }, - { - 'state': 'Shutdown', - 'availability': '(available)', - 'name': 'iPhone 6s', - 'udid': 'D0F29BE7-CC3C-4976-888D-C739B4F50508' - } - ], - 'iOS 10.0': [ - { - 'state': 'Shutdown', - 'availability': '(available)', - 'name': 'iPhone 6', - 'udid': '2FF48AE5-CC3B-4C80-8D25-48966A6BE2C0' - }, - { - 'state': 'Shutdown', - 'availability': '(available)', - 'name': 'iPhone 6 (Plus)', - 'udid': '841E33FE-E8A1-4B65-9FF8-6EAA6442A3FC' - }, - { - 'state': 'Shutdown', - 'availability': '(available)', - 'name': 'iPhone 6s', - 'udid': 'CBBB8FB8-77AB-49A9-8297-4CCFE3189C22' - }, - { - 'state': 'Booted', - 'availability': '(available)', - 'name': 'iPhone 7', - 'udid': '3A409DC5-5188-42A6-8598-3AA6F34607A5' - } - ] - } - }, - 'iPhone 6s (10.0)' - )).toEqual({ + expect( + findMatchingSimulator( + { + devices: { + 'iOS 9.2': [ + { + state: 'Shutdown', + availability: '(unavailable, runtime profile not found)', + name: 'iPhone 4s', + udid: 'B9B5E161-416B-43C4-A78F-729CB96CC8C6', + }, + { + state: 'Shutdown', + availability: '(available)', + name: 'iPhone 5', + udid: '1CCBBF8B-5773-4EA6-BD6F-C308C87A1ADB', + }, + { + state: 'Shutdown', + availability: '(available)', + name: 'iPhone 6', + udid: 'BA0D93BD-07E6-4182-9B0A-F60A2474139C', + }, + { + state: 'Shutdown', + availability: '(available)', + name: 'iPhone 6 (Plus)', + udid: '9564ABEE-9EC2-4B4A-B443-D3710929A45A', + }, + { + state: 'Shutdown', + availability: '(available)', + name: 'iPhone 6s', + udid: 'D0F29BE7-CC3C-4976-888D-C739B4F50508', + }, + ], + 'iOS 10.0': [ + { + state: 'Shutdown', + availability: '(available)', + name: 'iPhone 6', + udid: '2FF48AE5-CC3B-4C80-8D25-48966A6BE2C0', + }, + { + state: 'Shutdown', + availability: '(available)', + name: 'iPhone 6 (Plus)', + udid: '841E33FE-E8A1-4B65-9FF8-6EAA6442A3FC', + }, + { + state: 'Shutdown', + availability: '(available)', + name: 'iPhone 6s', + udid: 'CBBB8FB8-77AB-49A9-8297-4CCFE3189C22', + }, + { + state: 'Booted', + availability: '(available)', + name: 'iPhone 7', + udid: '3A409DC5-5188-42A6-8598-3AA6F34607A5', + }, + ], + }, + }, + 'iPhone 6s (10.0)', + ), + ).toEqual({ udid: 'CBBB8FB8-77AB-49A9-8297-4CCFE3189C22', name: 'iPhone 6s', booted: false, - version: 'iOS 10.0' + version: 'iOS 10.0', }); }); it('should return null if the version is specified and no device with the exact version exists (multi ios versions)', () => { - expect(findMatchingSimulator({ - 'devices': { - 'iOS 9.2': [ - { - 'state': 'Shutdown', - 'availability': '(unavailable, runtime profile not found)', - 'name': 'iPhone 4s', - 'udid': 'B9B5E161-416B-43C4-A78F-729CB96CC8C6' - }, - { - 'state': 'Shutdown', - 'availability': '(available)', - 'name': 'iPhone 5', - 'udid': '1CCBBF8B-5773-4EA6-BD6F-C308C87A1ADB' - }, - { - 'state': 'Shutdown', - 'availability': '(available)', - 'name': 'iPhone 6', - 'udid': 'BA0D93BD-07E6-4182-9B0A-F60A2474139C' - }, - { - 'state': 'Shutdown', - 'availability': '(available)', - 'name': 'iPhone 6 (Plus)', - 'udid': '9564ABEE-9EC2-4B4A-B443-D3710929A45A' - }, - { - 'state': 'Shutdown', - 'availability': '(available)', - 'name': 'iPhone 6s', - 'udid': 'D0F29BE7-CC3C-4976-888D-C739B4F50508' - } - ], - 'iOS 10.0': [ - { - 'state': 'Shutdown', - 'availability': '(available)', - 'name': 'iPhone 6', - 'udid': '2FF48AE5-CC3B-4C80-8D25-48966A6BE2C0' - }, - { - 'state': 'Shutdown', - 'availability': '(available)', - 'name': 'iPhone 6 (Plus)', - 'udid': '841E33FE-E8A1-4B65-9FF8-6EAA6442A3FC' - }, - { - 'state': 'Booted', - 'availability': '(available)', - 'name': 'iPhone 7', - 'udid': '3A409DC5-5188-42A6-8598-3AA6F34607A5' - } - ] - } - }, - 'iPhone 6s (10.0)' - )).toEqual(null); + expect( + findMatchingSimulator( + { + devices: { + 'iOS 9.2': [ + { + state: 'Shutdown', + availability: '(unavailable, runtime profile not found)', + name: 'iPhone 4s', + udid: 'B9B5E161-416B-43C4-A78F-729CB96CC8C6', + }, + { + state: 'Shutdown', + availability: '(available)', + name: 'iPhone 5', + udid: '1CCBBF8B-5773-4EA6-BD6F-C308C87A1ADB', + }, + { + state: 'Shutdown', + availability: '(available)', + name: 'iPhone 6', + udid: 'BA0D93BD-07E6-4182-9B0A-F60A2474139C', + }, + { + state: 'Shutdown', + availability: '(available)', + name: 'iPhone 6 (Plus)', + udid: '9564ABEE-9EC2-4B4A-B443-D3710929A45A', + }, + { + state: 'Shutdown', + availability: '(available)', + name: 'iPhone 6s', + udid: 'D0F29BE7-CC3C-4976-888D-C739B4F50508', + }, + ], + 'iOS 10.0': [ + { + state: 'Shutdown', + availability: '(available)', + name: 'iPhone 6', + udid: '2FF48AE5-CC3B-4C80-8D25-48966A6BE2C0', + }, + { + state: 'Shutdown', + availability: '(available)', + name: 'iPhone 6 (Plus)', + udid: '841E33FE-E8A1-4B65-9FF8-6EAA6442A3FC', + }, + { + state: 'Booted', + availability: '(available)', + name: 'iPhone 7', + udid: '3A409DC5-5188-42A6-8598-3AA6F34607A5', + }, + ], + }, + }, + 'iPhone 6s (10.0)', + ), + ).toEqual(null); }); it('should return AppleTV devices if in the list', () => { diff --git a/local-cli/runIOS/findMatchingSimulator.js b/local-cli/runIOS/findMatchingSimulator.js index d6769ce9c..30e2156d4 100644 --- a/local-cli/runIOS/findMatchingSimulator.js +++ b/local-cli/runIOS/findMatchingSimulator.js @@ -28,7 +28,9 @@ function findMatchingSimulator(simulators, simulatorString) { } const devices = simulators.devices; - const parsedSimulatorName = simulatorString ? simulatorString.match(/(.*)? (?:\((.*)?\))?/) : []; + const parsedSimulatorName = simulatorString + ? simulatorString.match(/(.*)? (?:\((.*)?\))?/) + : []; if (parsedSimulatorName[2] !== undefined) { var simulatorVersion = parsedSimulatorName[2]; var simulatorName = parsedSimulatorName[1]; diff --git a/local-cli/runIOS/runIOS.js b/local-cli/runIOS/runIOS.js index 6c7af3242..a7ecf7d6d 100644 --- a/local-cli/runIOS/runIOS.js +++ b/local-cli/runIOS/runIOS.js @@ -410,7 +410,7 @@ module.exports = { { command: '--simulator [string]', description: - 'Explicitly set simulator to use. Optionally include iOS version between' + + 'Explicitly set simulator to use. Optionally include iOS version between' + 'parenthesis at the end to match an exact version: "iPhone 6 (10.0)"', default: 'iPhone X', }, diff --git a/local-cli/templates/HelloWorld/App.js b/local-cli/templates/HelloWorld/App.js index 171d0f0f4..bb4823295 100644 --- a/local-cli/templates/HelloWorld/App.js +++ b/local-cli/templates/HelloWorld/App.js @@ -4,6 +4,7 @@ * * @format * @flow + * @lint-ignore-every XPLATJSCOPYRIGHT1 */ import React, {Component} from 'react'; diff --git a/local-cli/templates/HelloWorld/__tests__/App.js b/local-cli/templates/HelloWorld/__tests__/App.js index 2d06c1ba1..a79ec3d58 100644 --- a/local-cli/templates/HelloWorld/__tests__/App.js +++ b/local-cli/templates/HelloWorld/__tests__/App.js @@ -1,4 +1,7 @@ -/** @format */ +/** + * @format + * @lint-ignore-every XPLATJSCOPYRIGHT1 + */ import 'react-native'; import React from 'react'; diff --git a/local-cli/templates/HelloWorld/index.js b/local-cli/templates/HelloWorld/index.js index 802b4350d..3ac66525d 100644 --- a/local-cli/templates/HelloWorld/index.js +++ b/local-cli/templates/HelloWorld/index.js @@ -1,4 +1,7 @@ -/** @format */ +/** + * @format + * @lint-ignore-every XPLATJSCOPYRIGHT1 + */ import {AppRegistry} from 'react-native'; import App from './App';