Skip to content

getDefaultStore and testing without Provider #2747

Closed Answered by dai-shi
ugurcanatas asked this question in Q&A
Discussion options

You must be logged in to vote

2: We generally prefer ReturnType<> until we learn some unavoidable issues.

1: Resetting the default store would be challenging. I wonder if something like jest.mock can do it. Otherwise, you solution would be only the way. This shouldn't be Jotai-only problem. I wonder what's the best practice for resetting module variable in general in tests.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ugurcanatas
Comment options

@ugurcanatas
Comment options

@dmaskasky
Comment options

@ugurcanatas
Comment options

Answer selected by ugurcanatas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants