Skip to content

Commit 9f02c6e

Browse files
committed
Fixed tests
1 parent 413fb8c commit 9f02c6e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

test/unit-tests/toolchain/swiftly.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ suite("Swiftly Unit Tests", () => {
2121
const mockUtilities = mockGlobalModule(utilities);
2222
const mockedPlatform = mockGlobalValue(process, "platform");
2323

24+
setup(() => {
25+
mockedPlatform.setValue("darwin");
26+
});
27+
2428
suite("getSwiftlyToolchainInstalls", () => {
2529
test("should return toolchain names from list-available command for version 1.1.0", async () => {
2630
// Mock version check to return 1.1.0

test/unit-tests/toolchain/toolchain.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,11 @@ suite("SwiftToolchain Unit Test Suite", () => {
353353

354354
mockFS({});
355355

356-
await expect(Swiftly.listAvailableToolchains()).to.be.rejectedWith(
357-
"Failed to retrieve Swiftly installations from disk: ENOENT, no such file or directory '/home/user/.swiftly/config.json'"
358-
);
356+
await expect(Swiftly.listAvailableToolchains()).to.be.rejected.then(error => {
357+
expect(error.message).to.include(
358+
"Failed to retrieve Swiftly installations from disk"
359+
);
360+
});
359361
});
360362

361363
test("returns empty array when config has no installedToolchains", async () => {

0 commit comments

Comments
 (0)