mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 16:02:32 +00:00
test(runtime): drop the redundant status casts the new casting gate rejects
This commit is contained in:
@@ -21,7 +21,7 @@ function makeStatus(runtimeId: string): RuntimeStatus {
|
||||
liveLeafCount: 0,
|
||||
runtimeProtocolVersion: 3,
|
||||
minCompatibleRuntimeClientVersion: 3
|
||||
} as RuntimeStatus
|
||||
}
|
||||
}
|
||||
|
||||
function makeSnapshot(
|
||||
@@ -115,7 +115,15 @@ describe('mirror targets and host connection state agree on one host', () => {
|
||||
})
|
||||
|
||||
it('drops the mirror target when the control channel closed', () => {
|
||||
const closed = { state: 'closed' } as NonNullable<RuntimeStatus['remoteControl']>
|
||||
const closed: NonNullable<RuntimeStatus['remoteControl']> = {
|
||||
state: 'closed',
|
||||
pendingRequestCount: 0,
|
||||
subscriptionCount: 0,
|
||||
reconnectAttempt: 0,
|
||||
lastConnectedAt: null,
|
||||
lastClose: null,
|
||||
lastError: null
|
||||
}
|
||||
const entry = {
|
||||
...entryForSnapshot(makeSnapshot({ verification: 'verified' })),
|
||||
remoteControl: closed
|
||||
|
||||
+3
-1
@@ -21,6 +21,7 @@ type Store = ReturnType<typeof createSliceStore>
|
||||
|
||||
function createSliceStore() {
|
||||
return create<RuntimeStatusSlice>()((...a) => ({
|
||||
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the slice creator is declared against the whole AppState; this store holds only its own slice, which is all the code under test reads.
|
||||
...createRuntimeStatusSlice(...(a as unknown as Parameters<typeof createRuntimeStatusSlice>))
|
||||
}))
|
||||
}
|
||||
@@ -35,7 +36,7 @@ function makeStatus(runtimeId: string): RuntimeStatus {
|
||||
liveLeafCount: 0,
|
||||
runtimeProtocolVersion: 3,
|
||||
minCompatibleRuntimeClientVersion: 3
|
||||
} as RuntimeStatus
|
||||
}
|
||||
}
|
||||
|
||||
function makeSnapshot(
|
||||
@@ -55,6 +56,7 @@ function makeSnapshot(
|
||||
|
||||
/** The mirror-subscription effect dependency, rebuilt from the slice's current state. */
|
||||
function mirrorKey(store: Store): string {
|
||||
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the builder takes the whole app state; only the fields below reach the mirror-target scan.
|
||||
return buildRuntimeSessionMirrorEnvironmentKey({
|
||||
activeRuntimeEnvironmentId: ENVIRONMENT_ID,
|
||||
repos: [],
|
||||
|
||||
Reference in New Issue
Block a user