microsoft/vscode-react-native

Public

mirrored from https://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
f0161ba5b4933b844917e01f74fc7dfb17d2f862

Branches

Tags

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

Clone

HTTPS

Download ZIP

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

35lines · 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 projectName = "foo";
15 const fileType = ".xcodeproj";
16 const testFiles = [projectName + fileType];
17 const mockFileSystem: any = {
18 readDir: (path: string) => {
19 return Q(testFiles);
20 },
21 };
22
23 const xcodeproj = new Xcodeproj({ nodeFileSystem: mockFileSystem });
24
25 return xcodeproj.findXcodeprojFile(projectRoot)
26 .then((proj) => {
27 assert.deepEqual(proj, {
28 fileName: path.join(projectRoot, testFiles[0]),
29 fileType,
30 projectName,
31 });
32 });
33 });
34 });
35});