Skip to content

Async Iterators don't work #6492

@pranaygp

Description

@pranaygp

🐛 Bug Report

Async Iterators or generators simply don't work with jest even thought they're natively supported in Node 10

To Reproduce

  1. Install Node 10.x.x
  2. cd to a test project where jest works
  3. add async function* foo() {} to some file
  4. run your project (with yarn start or node index.js etc.)
  5. Notice that it works
  6. Try running your test cases yarn test
  7. Notice that jest complains about "unexpected token *"

Expected behavior

The test suite should run normally and not throw this error

Link to repl or repo (highly encouraged)

Seems like repl.it doesn't have node 10. Sorry :/

Issues without a reproduction link are likely to stall.

Run npx envinfo --preset jest

Paste the results here:

npx: installed 1 in 1.672s

  System:
    OS: macOS High Sierra 10.13.5
    CPU: x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  Binaries:
    Node: 10.3.0 - ~/.nvm/versions/node/v10.3.0/bin/node
    Yarn: 1.7.0 - ~/.yarn/bin/yarn
    npm: 6.1.0 - ~/.nvm/versions/node/v10.3.0/bin/npm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions