-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Fake Timer implementation does not have unref method in Node environment #4559
Comments
Oh yeah, we don't implement the same Timer interface. Would you be willing to add this functionality to FakeTimers, and sending a PR with tests? Thanks! |
@cpojer thanks for the quick response! I'll definitely try, but I'm not sure that I will succeed, so if someone else wants to implement this, then I will be glad :) |
@cpojer I'm trying to come up with a PR for this but since I'm new to the codebase I'm wondering if there's a standard way to determine the environment in jest (node/jsdom). Or should I execute a setTimeout in order to decide on the return type? This is how sinon.js handles it ... |
I guess FakeTimers is created by the env, so jest-environment-node could configure FakeTimers to use node's API. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Do you want to request a feature or report a bug?
Bug.
What is the current behavior?
The fake Timer implementation does not have unref method in Node environment.
If the current behavior is a bug, please provide the steps to reproduce and either a repl.it demo through https://repl.it/languages/jest or a minimal repository on GitHub that we can
yarn install
andyarn test
.https://repl.it/Lm5x
What is the expected behavior?
Fake Timer implementation should have unref method in Node environment.
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
Node - 8.5.0
Yarn - 1.1.0
Jest - 21.2.0
The text was updated successfully, but these errors were encountered: