History

test(server): make Windows path and async fixtures deterministic (#9576)

Julius Marminge committed 2 months ago

Commit b123cbb1 parent 5f4c7169 files · +125 −75Browse files

Showing the changes to apps/server/src/sourceControl/SourceControlRepositoryService.test.ts (1 of 9 files). Show all

Unified · Split

apps/server/src/sourceControl/SourceControlRepositoryService.test.ts+3−1
@@ -3,6 +3,7 @@ import * as NodeServices from "@effect/platform-node/NodeServices"; · 2 unmodified lines
33 import { assert, it } from "@effect/vitest";
44 import * as Effect from "effect/Effect";
55 import * as FileSystem from "effect/FileSystem";
6+import * as Path from "effect/Path";
67 import * as Layer from "effect/Layer";
78 import * as PlatformError from "effect/PlatformError";
89 import { ChildProcessSpawner } from "effect/unstable/process";
@@ -153,10 +154,11 @@ it.effect("preserves provider failures without deriving the repository message f · 144 unmodified lines
153154 it.effect("clones a looked-up repository into the requested destination", () =>
154155 Effect.gen(function* () {
155156 const fs = yield* FileSystem.FileSystem;
157+ const path = yield* Path.Path;
156158 const parent = yield* fs.makeTempDirectoryScoped({
157159 prefix: "t3-source-control-clone-parent-",
158160 });
159− const destinationPath = `${parent}/t3code`;
161+ const destinationPath = path.join(parent, "t3code");
160162 const cloneCalls: Array<{ cwd: string; args: ReadonlyArray<string> }> = [];
161163
162164 yield* Effect.gen(function* () {