@@ -10,7 +10,6 @@ import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/unstab
1010import {
1111 DesktopSshEnvironmentRequestError ,
1212 fetchSshEnvironmentDescriptor ,
13- fetchSshSessionState ,
1413} from "./sshEnvironment.ts" ;
1514
1615function jsonResponse ( request : HttpClientRequest . HttpClientRequest , body : unknown , status = 200 ) {
@@ -113,39 +112,4 @@ describe("SSH environment IPC", () => {
113112 assert . equal ( requestCount , 0 ) ;
114113 } ) . pipe ( Effect . provide ( layer ) ) ;
115114 } ) ;
116-
117- it . effect ( "preserves SSH HTTP status in top-level request error messages" , ( ) => {
118- const layer = makeHttpClientLayer ( ( request ) =>
119- Effect . succeed (
120- jsonResponse (
121- request ,
122- {
123- _tag : "EnvironmentAuthInvalidError" ,
124- code : "auth_invalid" ,
125- reason : "invalid_credential" ,
126- traceId : "11111111111111111111111111111111" ,
127- } ,
128- 401 ,
129- ) ,
130- ) ,
131- ) ;
132-
133- return Effect . gen ( function * ( ) {
134- const exit = yield * Effect . exit (
135- fetchSshSessionState . handler ( {
136- bearerToken : "stale-bearer-token" ,
137- httpBaseUrl : "http://127.0.0.1:41773/" ,
138- } ) ,
139- ) ;
140- assert ( Exit . isFailure ( exit ) ) ;
141- const failure = Cause . findErrorOption ( exit . cause ) ;
142- assert ( Option . isSome ( failure ) ) ;
143- const error = failure . value ;
144-
145- assert . instanceOf ( error , DesktopSshEnvironmentRequestError ) ;
146- assert . equal ( error . operation , "fetch-session-state" ) ;
147- assert . equal ( error . sshHttpStatus , 401 ) ;
148- assert . match ( error . message , / ^ \[ s s h _ h t t p : 4 0 1 \] / u) ;
149- } ) . pipe ( Effect . provide ( layer ) ) ;
150- } ) ;
151115} ) ;
0 commit comments