Showing the changes to apps/server/src/workspace/WorkspaceFileSystem.test.ts (1 of 2 files). Show all
Unified · Split
| @@ -137,8 +137,14 @@ it.layer(TestLayer, { excludeTestServices: true })("WorkspaceFileSystemLive", (i · 136 unmodified lines | ||
| 137 | 137 | error.message, |
| 138 | 138 | `Workspace file operation 'workspaceFileSystem.readFile' failed for 'image.bin' in '${cwd}'.`, |
| 139 | 139 | ); |
| 140 | − assert.ok(error.cause instanceof Error); | |
| 141 | − assert.strictEqual((error.cause as Error).message, "Binary files cannot be previewed as text."); | |
| 140 | + assert.strictEqual( | |
| 141 | + (error.cause as { readonly _tag?: string })._tag, | |
| 142 | + "WorkspaceReadFileBinaryFileError", | |
| 143 | + ); | |
| 144 | + assert.strictEqual( | |
| 145 | + (error.cause as { readonly message?: string }).message, | |
| 146 | + "Binary files cannot be previewed as text.", | |
| 147 | + ); | |
| 142 | 148 | }), |
| 143 | 149 | ); |
| 144 | 150 | |
| @@ -163,9 +169,12 @@ it.layer(TestLayer, { excludeTestServices: true })("WorkspaceFileSystemLive", (i · 18 unmodified lines | ||
| 163 | 169 | error.message, |
| 164 | 170 | `Workspace file operation 'workspaceFileSystem.readFile' failed for 'linked-secret.txt' in '${cwd}'.`, |
| 165 | 171 | ); |
| 166 | − assert.ok(error.cause instanceof Error); | |
| 167 | 172 | assert.strictEqual( |
| 168 | − (error.cause as Error).message, | |
| 173 | + (error.cause as { readonly _tag?: string })._tag, | |
| 174 | + "WorkspaceReadFileResolvedOutsideRootError", | |
| 175 | + ); | |
| 176 | + assert.strictEqual( | |
| 177 | + (error.cause as { readonly message?: string }).message, | |
| 169 | 178 | "Workspace file path resolves outside the project root.", |
| 170 | 179 | ); |
| 171 | 180 | }), |