History

Assert normalized filesystem platform errors

Cursor Agent committed 4 months ago

Commit 47f50251 parent 6241e151 file · +6 −2Browse files

Showing the changes to apps/server/src/workspace/WorkspaceFileSystem.test.ts (1 of 1 file). Show all

Unified · Split

apps/server/src/workspace/WorkspaceFileSystem.test.ts+6−2
@@ -1,9 +1,10 @@
1import * as NodeServices from "@effect/platform-node/NodeServices";1import * as NodeServices from "@effect/platform-node/NodeServices";
2import { it, describe, expect } from "@effect/vitest";2import { assert, it, describe, expect } from "@effect/vitest";
3import * as Effect from "effect/Effect";3import * as Effect from "effect/Effect";
4import * as FileSystem from "effect/FileSystem";4import * as FileSystem from "effect/FileSystem";
5import * as Layer from "effect/Layer";5import * as Layer from "effect/Layer";
6import * as Path from "effect/Path";6import * as Path from "effect/Path";
7import type * as PlatformError from "effect/PlatformError";
7 8
8import * as ServerConfig from "../config.ts";9import * as ServerConfig from "../config.ts";
9import * as VcsDriverRegistry from "../vcs/VcsDriverRegistry.ts";10import * as VcsDriverRegistry from "../vcs/VcsDriverRegistry.ts";
@@ -186,7 +187,10 @@ it.layer(TestLayer, { excludeTestServices: true })("WorkspaceFileSystemLive", (i · 176 unmodified lines
186 operation: "realpath-target",187 operation: "realpath-target",
187 });188 });
188 expect(error.cause).toBeInstanceOf(Error);189 expect(error.cause).toBeInstanceOf(Error);
189 expect((error.cause as NodeJS.ErrnoException).code).toBe("ENOENT");190 const cause = error.cause as PlatformError.PlatformError;
191 assert.equal(cause._tag, "PlatformError");
192 assert.equal(cause.reason._tag, "NotFound");
193 assert.equal(cause.reason.pathOrDescriptor, resolvedPath);
190 }),194 }),
191 );195 );
192 });196 });