Showing the changes to apps/server/src/workspace/WorkspaceFileSystem.test.ts (1 of 9 files). Show all
Unified · Split
| @@ -14,6 +14,7 @@ import * as VcsProcess from "../vcs/VcsProcess.ts"; · 13 unmodified lines | ||
| 14 | 14 | import * as WorkspaceEntries from "./WorkspaceEntries.ts"; |
| 15 | 15 | import * as WorkspaceFileSystem from "./WorkspaceFileSystem.ts"; |
| 16 | 16 | import * as WorkspacePaths from "./WorkspacePaths.ts"; |
| 17 | +import { HostProcessPlatform } from "@t3tools/shared/hostProcess"; | |
| 17 | 18 | import { symlinksSupported } from "@t3tools/shared/testing/symlinks"; |
| 18 | 19 | |
| 19 | 20 | const ProjectLayer = WorkspaceFileSystem.layer.pipe( |
| @@ -100,28 +101,31 @@ it.layer(TestLayer, { excludeTestServices: true })("WorkspaceFileSystemLive", (i · 80 unmodified lines | ||
| 100 | 101 | }), |
| 101 | 102 | ); |
| 102 | 103 | |
| 103 | − it.effect("rejects a FIFO without blocking on open", () => | |
| 104 | − Effect.gen(function* () { | |
| 105 | − const workspaceFileSystem = yield* WorkspaceFileSystem.WorkspaceFileSystem; | |
| 106 | − const path = yield* Path.Path; | |
| 107 | − const cwd = yield* makeTempDir; | |
| 108 | − const outsideDir = yield* makeTempDir; | |
| 109 | − const fifoPath = path.join(outsideDir, "pipe"); | |
| 110 | − yield* Effect.promise( | |
| 111 | − () => | |
| 112 | − new Promise<void>((resolve, reject) => | |
| 113 | − NodeChildProcess.execFile("mkfifo", [fifoPath], (error) => | |
| 114 | − error ? reject(error) : resolve(), | |
| 104 | + // Needs mkfifo; Windows has no FIFOs to reject. | |
| 105 | + it.effect.skipIf(HostProcessPlatform.defaultValue() === "win32")( | |
| 106 | + "rejects a FIFO without blocking on open", | |
| 107 | + () => | |
| 108 | + Effect.gen(function* () { | |
| 109 | + const workspaceFileSystem = yield* WorkspaceFileSystem.WorkspaceFileSystem; | |
| 110 | + const path = yield* Path.Path; | |
| 111 | + const cwd = yield* makeTempDir; | |
| 112 | + const outsideDir = yield* makeTempDir; | |
| 113 | + const fifoPath = path.join(outsideDir, "pipe"); | |
| 114 | + yield* Effect.promise( | |
| 115 | + () => | |
| 116 | + new Promise<void>((resolve, reject) => | |
| 117 | + NodeChildProcess.execFile("mkfifo", [fifoPath], (error) => | |
| 118 | + error ? reject(error) : resolve(), | |
| 119 | + ), | |
| 115 | 120 | ), |
| 116 | − ), | |
| 117 | − ); | |
| 121 | + ); | |
| 118 | 122 | |
| 119 | − const error = yield* workspaceFileSystem | |
| 120 | − .readFile({ cwd, relativePath: fifoPath }) | |
| 121 | − .pipe(Effect.flip); | |
| 123 | + const error = yield* workspaceFileSystem | |
| 124 | + .readFile({ cwd, relativePath: fifoPath }) | |
| 125 | + .pipe(Effect.flip); | |
| 122 | 126 | |
| 123 | − expect(error).toBeInstanceOf(WorkspaceFileSystem.WorkspacePathNotFileError); | |
| 124 | − }), | |
| 127 | + expect(error).toBeInstanceOf(WorkspaceFileSystem.WorkspacePathNotFileError); | |
| 128 | + }), | |
| 125 | 129 | ); |
| 126 | 130 | |
| 127 | 131 | it.effect("rejects reads outside the workspace root", () => |