Skip to content

Commit c35b349

Browse files
committed
test: skip the macOS-only ios-project-service suites off darwin
Four suites in this file guard their bodies with a darwin check, so on any other platform the describe registers no tests at all. Mocha accepts an empty suite silently - which is why the Linux CI count is 1501 against 1514 locally, with nothing to indicate the difference - but vitest treats one as an error. Gating the suite instead of the body fixes it without touching the bodies: an empty suite is tolerated when it is skipped.
1 parent 457d33f commit c35b349

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

test/ios-project-service.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,13 @@ function createPackageJson(
268268
.writeJson(join(projectPath, "package.json"), packageJsonData);
269269
}
270270

271-
describe("Cocoapods support", () => {
271+
// These suites only define tests on macOS - each body is internally gated on
272+
// darwin. Marking the suite skipped elsewhere is what keeps the runner from
273+
// erroring on an empty suite; an empty suite is only tolerated when skipped.
274+
const describeOnMacOS =
275+
require("os").platform() === "darwin" ? describe : describe.skip;
276+
277+
describeOnMacOS("Cocoapods support", () => {
272278
if (require("os").platform() !== "darwin") {
273279
console.log("Skipping Cocoapods tests. They cannot work on windows");
274280
} else {
@@ -657,7 +663,7 @@ describe("Cocoapods support", () => {
657663
}
658664
});
659665

660-
describe("Source code support", () => {
666+
describeOnMacOS("Source code support", () => {
661667
if (require("os").platform() !== "darwin") {
662668
console.log(
663669
"Skipping Source code in plugin tests. They cannot work on windows",
@@ -978,7 +984,7 @@ describe("Source code support", () => {
978984
}
979985
});
980986

981-
describe("Static libraries support", () => {
987+
describeOnMacOS("Static libraries support", () => {
982988
if (require("os").platform() !== "darwin") {
983989
console.log("Skipping static library tests. They work only on darwin.");
984990
return;
@@ -1107,7 +1113,7 @@ describe("Relative paths", () => {
11071113
});
11081114
});
11091115

1110-
describe("Merge Project XCConfig files", () => {
1116+
describeOnMacOS("Merge Project XCConfig files", () => {
11111117
if (require("os").platform() !== "darwin") {
11121118
console.log(
11131119
"Skipping 'Merge Project XCConfig files' tests. They can work only on macOS",

0 commit comments

Comments
 (0)