Skip to content

Commit 48e2f6b

Browse files
Fix failing unit test on windows for Relative paths
1 parent 4c5ea08 commit 48e2f6b

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

test/ios-project-service.ts

+15-15
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ describe("Cocoapods support", () => {
303303
let pluginPath = temp.mkdirSync("pluginDirectory");
304304
let pluginPlatformsFolderPath = path.join(pluginPath, "platforms", "ios");
305305
let pluginPodfilePath = path.join(pluginPlatformsFolderPath, "Podfile");
306-
let pluginPodfileContent = ["source 'https://github.com/CocoaPods/Specs.git'", "platform :ios, '8.1'", "pod 'GoogleMaps'"].join("\n");
306+
let pluginPodfileContent = ["source 'https://github.com/CocoaPods/Specs.git'", "platform :ios, '8.1'", "pod 'GoogleMaps'"].join("\n");
307307
fs.writeFile(pluginPodfilePath, pluginPodfileContent).wait();
308308

309309
let pluginData = {
@@ -373,7 +373,7 @@ describe("Cocoapods support", () => {
373373
let pluginPath = temp.mkdirSync("pluginDirectory");
374374
let pluginPlatformsFolderPath = path.join(pluginPath, "platforms", "ios");
375375
let pluginPodfilePath = path.join(pluginPlatformsFolderPath, "Podfile");
376-
let pluginPodfileContent = ["source 'https://github.com/CocoaPods/Specs.git'", "platform :ios, '8.1'", "pod 'GoogleMaps'"].join("\n");
376+
let pluginPodfileContent = ["source 'https://github.com/CocoaPods/Specs.git'", "platform :ios, '8.1'", "pod 'GoogleMaps'"].join("\n");
377377
fs.writeFile(pluginPodfilePath, pluginPodfileContent).wait();
378378

379379
let pluginData = {
@@ -417,7 +417,7 @@ describe("Static libraries support", () => {
417417
let testInjector = createTestInjector(projectPath, projectName);
418418
let fs: IFileSystem = testInjector.resolve("fs");
419419
let staticLibraryPath = path.join(path.join(temp.mkdirSync("pluginDirectory"), "platforms", "ios"));
420-
let staticLibraryHeadersPath = path.join(staticLibraryPath,"include", libraryName);
420+
let staticLibraryHeadersPath = path.join(staticLibraryPath, "include", libraryName);
421421

422422
it("checks validation of header files", () => {
423423
let iOSProjectService = testInjector.resolve("iOSProjectService");
@@ -430,7 +430,7 @@ describe("Static libraries support", () => {
430430
let error: any;
431431
try {
432432
iOSProjectService.validateStaticLibrary(path.join(staticLibraryPath, libraryName + ".a")).wait();
433-
} catch(err) {
433+
} catch (err) {
434434
error = err;
435435
}
436436

@@ -457,7 +457,7 @@ describe("Static libraries support", () => {
457457
let error: any;
458458
try {
459459
modulemap = fs.readFile(path.join(staticLibraryHeadersPath, "module.modulemap")).wait();
460-
} catch(err) {
460+
} catch (err) {
461461
error = err;
462462
}
463463

@@ -466,16 +466,16 @@ describe("Static libraries support", () => {
466466
});
467467

468468
describe("Relative paths", () => {
469-
it("checks for correct calculation of relative paths", () => {
470-
let projectName = "projectDirectory";
471-
let projectPath = temp.mkdirSync(projectName);
472-
let subpath = path.join(projectPath, "sub/path");
469+
it("checks for correct calculation of relative paths", () => {
470+
let projectName = "projectDirectory";
471+
let projectPath = temp.mkdirSync(projectName);
472+
let subpath = path.join(projectPath, "sub", "path");
473473

474-
let testInjector = createTestInjector(projectPath, projectName);
475-
createPackageJson(testInjector, projectPath, projectName);
476-
let iOSProjectService = testInjector.resolve("iOSProjectService");
474+
let testInjector = createTestInjector(projectPath, projectName);
475+
createPackageJson(testInjector, projectPath, projectName);
476+
let iOSProjectService = testInjector.resolve("iOSProjectService");
477477

478-
let result = iOSProjectService.getLibSubpathRelativeToProjectPath(subpath);
479-
assert.equal(result, "../../sub/path");
480-
});
478+
let result = iOSProjectService.getLibSubpathRelativeToProjectPath(subpath);
479+
assert.equal(result, path.join("..", "..", "sub", "path"));
480+
});
481481
});

0 commit comments

Comments
 (0)