Skip to content

Fix unit-tests on Windows and Linux #3086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 25 additions & 16 deletions test/ios-project-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,21 @@ describe("iOSProjectService", () => {
}
};
}
it("by default exports xcodearchive to platforms/ios/build/archive/<projname>.xcarchive", async () => {
let setup = await setupArchive();
await setup.run();
setup.assert();
});
it("can pass archivePath to xcodebuild -archivePath", async () => {
let setup = await setupArchive({ archivePath: "myarchive.xcarchive" });
await setup.run();
setup.assert();
});

if (require("os").platform() !== "darwin") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in many places ;)
These are tests, so I'll live with it for the moment. In the future we may introduce a property of it and define and handle it automatically.

console.log("Skipping iOS archive tests. They can work only on macOS");
} else {
it("by default exports xcodearchive to platforms/ios/build/archive/<projname>.xcarchive", async () => {
let setup = await setupArchive();
await setup.run();
setup.assert();
});
it("can pass archivePath to xcodebuild -archivePath", async () => {
let setup = await setupArchive({ archivePath: "myarchive.xcarchive" });
await setup.run();
setup.assert();
});
}
});

describe("exportArchive", () => {
Expand Down Expand Up @@ -282,13 +287,17 @@ describe("iOSProjectService", () => {
assert.ok(xcodebuildExeced, "Expected xcodebuild to be executed");
}

it("calls xcodebuild -exportArchive to produce .IPA", async () => {
await testExportArchive({}, noTeamPlist);
});
if (require("os").platform() !== "darwin") {
console.log("Skipping iOS export archive tests. They can work only on macOS");
} else {
it("calls xcodebuild -exportArchive to produce .IPA", async () => {
await testExportArchive({}, noTeamPlist);
});

it("passes the --team-id option down the xcodebuild -exportArchive throug the -exportOptionsPlist", async () => {
await testExportArchive({ teamID: "MyTeam" }, myTeamPlist);
});
it("passes the --team-id option down the xcodebuild -exportArchive throug the -exportOptionsPlist", async () => {
await testExportArchive({ teamID: "MyTeam" }, myTeamPlist);
});
}
});
});

Expand Down