diff --git a/test/thunk.test.ts b/test/thunk.test.ts index 1aa41ef..e1e75c8 100644 --- a/test/thunk.test.ts +++ b/test/thunk.test.ts @@ -625,3 +625,30 @@ it( ); }, ); + +it.only( + tests, + "should allow multiple stores to register a thunk", + () => { + const api1 = createThunks(); + api1.use(api1.routes()); + + const storeA = createStore({ initialState: {} }); + const storeB = createStore({ initialState: {} }); + storeA.run(api1.register); + storeB.run(api1.register); + + let acc = ""; + const action = api1.create("/users", function* () { + acc += "b"; + }); + storeA.dispatch(action()); + storeB.dispatch(action()); + + asserts.assertEquals( + acc, + "bb", + "Expected 'bb' after first API call, but got: " + acc, + ); + }, +);