avoiding the import "regenerator-runtime/runtime"

I am using Parcel to bundle my project and jest to run my tests.

Everything works fine, but on tests that I have the async/await keyword, I had to import regenerator-runtime/runtime

Like this:

import "regenerator-runtime/runtime"

test("read armored key", async() => {


And this work.

But without this import (import "regenerator-runtime/runtime") I got this error message:

ReferenceError: regeneratorRuntime is not defined

How can I change my project to run without this import on tests with async?

Example: https://github.com/skhaz/parcel-regeneratorRuntime-is-not-defined

21 thoughts on “avoiding the import "regenerator-runtime/runtime"”