microsoft/vscode-react-native

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
0.1.1

Branches

Tags

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

Clone

HTTPS

Download ZIP

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

33lines · modeblame

81226dceJimmy Thomson10 years ago1// 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
f5edf87fJimmy Thomson10 years ago6import * as assert from "assert";
81226dceJimmy Thomson10 years ago7import * as path from "path";
8import * as Q from "q";
9
10suite("xcodeproj", function() {
11suite("commonContext", function() {
12test("should look in the correct location for xcodeproj files and return one", function() {
2bc72bf2Jimmy Thomson10 years ago13const projectRoot = path.join("/", "tmp", "myProject");
81226dceJimmy Thomson10 years ago14const extension = "xcodeproj";
15const testFiles = ["foo.xcodeproj"];
16const mockFileSystem: any = {
17findFilesByExtension: (path: string, ext: string) => {
18if (extension !== ext) {
db80cd4eJimmy Thomson10 years ago19throw new Error(`Expected ${extension} got ${ext}`);
81226dceJimmy Thomson10 years ago20}
21return Q(testFiles);
22}
db80cd4eJimmy Thomson10 years ago23};
24
81226dceJimmy Thomson10 years ago25const xcodeproj = new Xcodeproj({ nodeFileSystem: mockFileSystem });
26
27return xcodeproj.findXcodeprojFile(projectRoot)
28.then((file) => {
2bc72bf2Jimmy Thomson10 years ago29assert.equal(file, testFiles[0]);
db80cd4eJimmy Thomson10 years ago30});
81226dceJimmy Thomson10 years ago31});
32});
33});