Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add tests? #28

Open
beaugunderson opened this issue Aug 24, 2018 · 1 comment
Open

How to add tests? #28

beaugunderson opened this issue Aug 24, 2018 · 1 comment

Comments

@beaugunderson
Copy link

beaugunderson commented Aug 24, 2018

We use redux-idle-monitor and I want to ensure that it works as expected for us in production--my idea was to do this in a front-end test by manually dispatching a NEXT_IDLE_STATE or GOTO_IDLE_STATE action. I can dispatch the actions but NEXT_IDLE_STATE starts a timer, which is not what I want, and GOTO_IDLE_STATE updates the state but never triggers my idleStatusAction.

What would you recommend?

@cchamberlain
Copy link
Member

Sorry for the long delay on this, things have been stable and my work has been busy. Thanks for opening this.

I'd think you'd need some async in your tests, a delay to see if things change. A lot depends on the testing environment, the code base has some checks to detect if it's being server rendered and disables some functionality there to avoid leaks in node.js. Some of these tests might better live inside the core code itself. Definitely open to PRs if you need to modify something to make it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants