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

Missing node global performance in test environment #11629

Closed
silverwind opened this issue Jul 1, 2021 · 1 comment · Fixed by #12002
Closed

Missing node global performance in test environment #11629

silverwind opened this issue Jul 1, 2021 · 1 comment · Fixed by #12002

Comments

@silverwind
Copy link
Contributor

silverwind commented Jul 1, 2021

🐛 Bug Report

The performance global introduced in Node.js 16.0.0 seems unavailable in the test environment.

To Reproduce

On Node 16.0.0 or greater:

mkdir perf && cd perf
npm init -y
echo 'console.log(performance.now())' > test.js
npm install jest
npx jest

Expected behavior

No error

Actual behavior

 FAIL  ./test.js
  ● Test suite failed to run

    ReferenceError: performance is not defined

    > 1 | console.log(performance.now())
        | ^
      2 |

      at Object.<anonymous> (test.js:1:1)
      at TestScheduler.scheduleTests (node_modules/@jest/core/build/TestScheduler.js:333:13)
@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant