microsoft/vscode-react-native

Public

mirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
bb77358c8dc7ea46fae9d6aa601a11fde8eed0fd

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/test/common/ios/xcodeproj.test.ts

33lines · 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
4import {Xcodeproj} from "../../../common/ios/xcodeproj";
5
6import * as assert from "assert";
7import * as path from "path";
8import * as Q from "q";
9
10suite("xcodeproj", function() {
11 suite("commonContext", function() {
12 test("should look in the correct location for xcodeproj files and return one", function() {
13 const projectRoot = path.join("/", "tmp", "myProject");
14 const extension = "xcodeproj";
15 const testFiles = ["foo.xcodeproj"];
16 const mockFileSystem: any = {
17 findFilesByExtension: (path: string, ext: string) => {
18 if (extension !== ext) {
19 throw new Error(`Expected ${extension} got ${ext}`);
20 }
21 return Q(testFiles);
22 },
23 };
24
25 const xcodeproj = new Xcodeproj({ nodeFileSystem: mockFileSystem });
26
27 return xcodeproj.findXcodeprojFile(projectRoot)
28 .then((file) => {
29 assert.equal(file, testFiles[0]);
30 });
31 });
32 });
33});