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

ReferenceError: regeneratorRuntime is not defined if use async test #11

Open
pontakornth opened this issue Sep 12, 2021 · 1 comment
Open

Comments

@pontakornth
Copy link

pontakornth commented Sep 12, 2021

I think I setup something wrong. I created the project using Vite and using this template.

Steps to reproduce

  1. Set up an async test
  2. Try to run test with jest command

Expected Behavior

Tests should run fine.

Actual Behavior

This error. ReferenceError: regeneratorRuntime

Note

I tried to use babel and add configuration file and tried to install regenerator-runtime. They do nothing.

Edit 1: I need to import regenerator-runtime manually. Actually, I expect that it should work without manual import.

@mwood23
Copy link

mwood23 commented Mar 28, 2022

If folks are looking for a solution to this I added this to my setupTests.js file for Jest to make it go.

// setupTests.js

import 'regenerator-runtime/runtime'

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