-
Notifications
You must be signed in to change notification settings - Fork 456
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
Async iterables don't work #471
Comments
@slikts Can you please create a minimal repo that reproduces this issue? |
Repo: https://github.com/slikts/ts-jest-issue
Edit: it might be relevant that when installing the deps, I get this notice:
However, typescript is clearly in the dependencies and gets installed. |
Using |
I've also added a .js file to show that async generators there work fine. |
@slikts the By default, jest uses babel to process js files (which is why there's no error in the js file) but it expects the other transformers to return code in a form that it understands without any further processing which can be |
Hmm... perhaps ts-jest should optionally allow compiled ts code to run through babel? I would guess that the underlying problem is jestjs/jest#6492 . However, it would seem that misalignment between javascript and jest is always possible going forward, which is precisely why the jest uses babel. |
@shaunc it does, it's just an option to activate, see |
Ah - nice :) |
I have the following async generator in my code:
This causes an "Unexpected token" when trying to run from a .ts file, but not a .js file, since I'm running node with the
--harmony-async-iteration
flag so async iteration works in .js files.Async iteration should also work with ts-jest since TS itself supports it.
https://gist.github.com/slikts/edf805370c43f97988c872dfa7ca5d48
Versions:
"jest": "^22.4.2",
"ts-jest": "^22.4.2",
"ts-node": "^5.0.1",
"typescript": "^2.8.0-rc"
The text was updated successfully, but these errors were encountered: