From 9eaf94db441017a69778dee34736b002b2ee6702 Mon Sep 17 00:00:00 2001 From: Ramon Brullo Date: Tue, 28 May 2024 11:19:11 +0200 Subject: [PATCH] test: make os independent Some tests failed when running on windows, specifically because of different path separators. This is now fixed. --- test/io/upm-config-io.test.ts | 2 +- test/services/parse-env.test.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/io/upm-config-io.test.ts b/test/io/upm-config-io.test.ts index 3f54129e..2e396c30 100644 --- a/test/io/upm-config-io.test.ts +++ b/test/io/upm-config-io.test.ts @@ -25,7 +25,7 @@ describe("upm-config-io", () => { describe("no wsl and no system-user", () => { it("should be in home path", async () => { const { getUpmConfigPath, getHomePath } = makeDependencies(); - const expected = "/some/home/dir/.upmconfig.toml"; + const expected = path.resolve("/some/home/dir/.upmconfig.toml"); getHomePath.mockReturnValue(Ok(path.dirname(expected))); const result = await getUpmConfigPath(false, false).promise; diff --git a/test/services/parse-env.test.ts b/test/services/parse-env.test.ts index 8565a6f3..e72a7ce0 100644 --- a/test/services/parse-env.test.ts +++ b/test/services/parse-env.test.ts @@ -14,6 +14,7 @@ import { mockService } from "./service.mock"; import { GetCwd } from "../../src/io/special-paths"; import { LoadProjectVersion } from "../../src/io/project-version-io"; import { GenericIOError } from "../../src/io/common-errors"; +import path from "path"; const testRootPath = "/users/some-user/projects/MyUnityProject"; @@ -457,7 +458,7 @@ describe("env", () => { it("should be specified path if overridden", async () => { const { parseEnv } = makeDependencies(); - const expected = "/some/other/path"; + const expected = path.resolve("/some/other/path"); const result = await parseEnv({ _global: {