microsoft/vscode-react-native
Publicmirrored from https://github.com/microsoft/vscode-react-nativeAvailable
test/extension/ios/iOSPlatform.test.ts
49lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT license. See LICENSE file in the project root for details. |
| 3 | |
| 4 | import * as assert from "assert"; |
| 5 | |
| 6 | import { IOSPlatform } from "../../../src/extension/ios/iOSPlatform"; |
| 7 | |
| 8 | import "should"; |
| 9 | |
| 10 | suite("iOSPlatform", function () { |
| 11 | let runOptions: any = { |
| 12 | platform: "ios", |
| 13 | workspaceRoot: "/User/test/react-native/AwesomeProject", |
| 14 | projectRoot: "/User/test/react-native/AwesomeProject", |
| 15 | }; |
| 16 | |
| 17 | teardown(() => { |
| 18 | runOptions = { |
| 19 | platform: "ios", |
| 20 | workspaceRoot: "/User/test/react-native/AwesomeProject", |
| 21 | projectRoot: "/User/test/react-native/AwesomeProject", |
| 22 | }; |
| 23 | }); |
| 24 | |
| 25 | suite("extensionContext", function () { |
| 26 | test("getRunArgument properties not defined", function () { |
| 27 | let platform = new IOSPlatform(runOptions); |
| 28 | assert.deepEqual(platform.getRunArgument(), []); |
| 29 | }); |
| 30 | test("getRunArgument simulator simulator", function () { |
| 31 | runOptions.target = "simulator"; |
| 32 | const expected = ["--simulator"]; |
| 33 | let platform = new IOSPlatform(runOptions); |
| 34 | assert.deepEqual(platform.getRunArgument(), expected); |
| 35 | }); |
| 36 | test("getRunArgument device device", function () { |
| 37 | runOptions.target = "device"; |
| 38 | const expected = ["--device"]; |
| 39 | let platform = new IOSPlatform(runOptions); |
| 40 | assert.deepEqual(platform.getRunArgument(), expected); |
| 41 | }); |
| 42 | test("getRunArgument simulator iPhone 6", function () { |
| 43 | runOptions.target = "iPhone 6"; |
| 44 | const expected = ["--simulator", runOptions.target]; |
| 45 | let platform = new IOSPlatform(runOptions); |
| 46 | assert.deepEqual(platform.getRunArgument(), expected); |
| 47 | }); |
| 48 | }); |
| 49 | }); |
| 50 | |