mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-07-28 04:08:05 +00:00
fix two-level merging of state in tests
This commit is contained in:
+4
-1
@@ -72,7 +72,10 @@ export class AsyncSaga {
|
||||
}
|
||||
|
||||
public updateState(state: RecursivePartial<RootState>): void {
|
||||
this.state = { ...this.state, ...state };
|
||||
for (const key of Object.keys(state) as Array<keyof RootState>) {
|
||||
// @ts-expect-error: writing to readonly for testing
|
||||
this.state[key] = { ...this.state[key], ...state[key] };
|
||||
}
|
||||
}
|
||||
|
||||
public async end(): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user