feat: add memory option in the testing adapter#1133
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
|
@georgwittberger could you try the following deployment build in your setup please? I confirmed it passes the reset test in your reproduction repository. You'll need to add the Without memory, all state updates are based on the initial search params, which might work for testing units of behaviour, but causes problems with the optimistic state flow you described (brilliantly) in #1099 (comment). There may be a better fix by seeing how to reset the queue differently in the testing adapter, I'll see if I can rework this PR later (but I think the memory mode has value on its own, for testing multiple updates in a more intuitive way). |
|
Yes, this works for the component test. Should solve the issues with the testing adapter. |
|
🎉 This PR is included in version 2.7.0-beta.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 2.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Partial solution for the #1099 issue, where the state transients through an old value during testing.
This is not the most ideal solution as it may need a change in core, or in how the testing adapter resets its queue, but the lack of memory (state updates only using the initial search params as a base for updates) caused me a few headaches in tests, and this can help make the testing setup behave more closely to other adapters.