@@ -73,7 +73,9 @@ function status(
7373 } ;
7474}
7575
76- const makeHarness = Effect . fn ( "RelayDiscoveryTest.makeHarness" ) ( function * ( ) {
76+ const makeHarness = Effect . fn ( "RelayDiscoveryTest.makeHarness" ) ( function * ( options ?: {
77+ readonly connectivityChanges ?: boolean ;
78+ } ) {
7779 const networkStatus = yield * SubscriptionRef . make < NetworkStatus > ( "online" ) ;
7880 const listCalls = yield * Ref . make ( 0 ) ;
7981 const listFailure = yield * Ref . make < ManagedRelay . ManagedRelayClientError | null > ( null ) ;
@@ -139,7 +141,10 @@ const makeHarness = Effect.fn("RelayDiscoveryTest.makeHarness")(function* () {
139141 } satisfies ManagedRelay . ManagedRelayClient [ "Service" ] ) ;
140142 const connectivity = Connectivity . Connectivity . of ( {
141143 status : SubscriptionRef . get ( networkStatus ) ,
142- changes : SubscriptionRef . changes ( networkStatus ) ,
144+ changes :
145+ options ?. connectivityChanges === false
146+ ? Stream . never
147+ : SubscriptionRef . changes ( networkStatus ) ,
143148 } ) ;
144149 const layer = RelayEnvironmentDiscovery . layer . pipe (
145150 Layer . provide (
@@ -345,7 +350,7 @@ describe("RelayEnvironmentDiscovery", () => {
345350
346351 it . effect ( "preserves known names throughout a same-account refresh failure" , ( ) =>
347352 Effect . gen ( function * ( ) {
348- const harness = yield * makeHarness ( ) ;
353+ const harness = yield * makeHarness ( { connectivityChanges : false } ) ;
349354 yield * Effect . gen ( function * ( ) {
350355 const discovery = yield * RelayEnvironmentDiscovery . RelayEnvironmentDiscovery ;
351356 const requests = yield * Ref . get ( harness . statusRequests ) ;
@@ -377,9 +382,9 @@ describe("RelayEnvironmentDiscovery", () => {
377382 yield * discovery . refresh ;
378383
379384 const failed = yield * SubscriptionRef . get ( discovery . state ) ;
380- expect ( [ ... failed . environments . values ( ) ] . map ( ( { environment } ) => environment ) ) . toEqual (
381- [ ... known . values ( ) ] . map ( ( { environment } ) => environment ) ,
382- ) ;
385+ for ( const [ id , entry ] of known ) {
386+ expect ( failed . environments . get ( id ) ?. environment ) . toBe ( entry . environment ) ;
387+ }
383388 expect (
384389 [ ...failed . environments . values ( ) ] . every (
385390 ( entry ) => Option . isNone ( entry . status ) && entry . availability === "error" ,
0 commit comments