-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Magic assert doesn't seem to work with "type": "module" #2719
Comments
It strikes me that the path is I haven't had a chance yet to try and reproduce this but it's on my radar. |
I suspect the problem is here: Lines 25 to 34 in b8f5685
I haven't tested it directly, but this came up in my work for #2741. |
@novemberborn not sure if it is fixed by #2741. I encountered the same issue today and tried with the master branch. The issue is still reproducible. Same setup as @Filyus, |
well, forgive my ignorance @novemberborn. Just found out that I would need additional configuration to work with precompiled typescript. |
unfortunately, es modules do not work with the I was curious though. My setup has IDE watchers that auto compile the typescript to javascript in the same folder on change. This was a nice setup for me because I can use these auto transpiled codebase directly as the artifact without needing a bundle (at least in dev). I expected the same to work for I was playing with the codebase and seems it works if the check to match stack trace with the test file does not check the extension strictly. I think this would work nicely even if the js is transpiled to another folder, given that source maps are generated during transpile. Find the change I made to try this in screenshot below, I basically changed line 40 to line 41 in Do you think this could be something that can be supported, maybe under a configuration flag or so? @novemberborn I think all of the typescript projects that do not bundle should work with this approach without needing |
If you're game @jiby-gh, it shouldn't be too hard to implement, see avajs/typescript#5 (comment).
I don't quite follow, sorry. What is your suggestion? |
Just add
"type": "module"
to package.json and run the failing test in ES-module, you don't see any code in the logs. I don't want to install something like Babel.ava 3.15.0
Node 12.20.0
test.js:
log:
Related: #2293
The text was updated successfully, but these errors were encountered: