Skip to content
This repository has been archived by the owner on Sep 1, 2021. It is now read-only.

[Feature]: Fake Timers #34

Open
daniel-nagy opened this issue Feb 28, 2019 · 5 comments
Open

[Feature]: Fake Timers #34

daniel-nagy opened this issue Feb 28, 2019 · 5 comments

Comments

@daniel-nagy
Copy link
Contributor

It looks like fake timers have been purposefully turned off. Would it be possible to implement fake timers?

@aaronabramov
Copy link
Contributor

there was an issue with a shared state in the early version of this runner (all tests shared the same window) and using fake timers was really unsafe, but i think current implementation should allow implementing fake timers. i have not looked into it yet!

pull request would be appreciated 🙂
here's where they're initialized (or disabled in this case)
https://github.com/facebook-atom/jest-electron-runner/blob/master/packages/electron/src/Environment.js#L24-L30

@daniel-nagy
Copy link
Contributor Author

Unsafe as in Spectre and Meltdown unsafe?

@aaronabramov
Copy link
Contributor

not that unsafe 😅
but potentially can leak state from one test to another. I think right now we're running every test in a separate electron window and disposing it after the test is done, so it should be easy to implement the same support as the main jest runner

@steel
Copy link

steel commented Jun 25, 2020

I created a PR here: #67

@witthong
Copy link

witthong commented Feb 3, 2021

Would it be possible to implement fake timers?

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

No branches or pull requests

4 participants