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
3import { assert, it } from "@effect/vitest";3import { assert, it } from "@effect/vitest";
4import * as Effect from "effect/Effect";4import * as Effect from "effect/Effect";
5import * as FileSystem from "effect/FileSystem";5import * as FileSystem from "effect/FileSystem";
6import * as Path from "effect/Path";
6import * as Layer from "effect/Layer";7import * as Layer from "effect/Layer";
7import * as PlatformError from "effect/PlatformError";8import * as PlatformError from "effect/PlatformError";
8import { ChildProcessSpawner } from "effect/unstable/process";9import { ChildProcessSpawner } from "effect/unstable/process";
@@ -153,10 +154,11 @@ it.effect("preserves provider failures without deriving the repository message f · 144 unmodified lines
153it.effect("clones a looked-up repository into the requested destination", () =>154it.effect("clones a looked-up repository into the requested destination", () =>
154 Effect.gen(function* () {155 Effect.gen(function* () {
155 const fs = yield* FileSystem.FileSystem;156 const fs = yield* FileSystem.FileSystem;
157 const path = yield* Path.Path;
156 const parent = yield* fs.makeTempDirectoryScoped({158 const parent = yield* fs.makeTempDirectoryScoped({
157 prefix: "t3-source-control-clone-parent-",159 prefix: "t3-source-control-clone-parent-",
158 });160 });
159 const destinationPath = `${parent}/t3code`;161 const destinationPath = path.join(parent, "t3code");
160 const cloneCalls: Array<{ cwd: string; args: ReadonlyArray<string> }> = [];162 const cloneCalls: Array<{ cwd: string; args: ReadonlyArray<string> }> = [];
161 163
162 yield* Effect.gen(function* () {164 yield* Effect.gen(function* () {