-
Notifications
You must be signed in to change notification settings - Fork 16
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
Clarify use #24
Clarify use #24
Conversation
Can I ask about your project which led you to get stuck? Is it that you have The former situation I think we should move this paragraph to the |
I don't think either option for your question is what I found. Maybe I had a misunderstanding. Let me explain. My project is an Electron (main/Node-side) runtime library, so basically a Node module. It was already written in TypeScript using imports & exports, then I added some tests. I started adding tests, ESLint, and Prettier all in one go and I spent more time than I'd like to realise this package doesn't like imports. I just wanted to point it out in the README to save someone else time. I wrote the tests in JS for the time being. Looking at the compiled output, I see I had configured ava + babel. I remember that I had two identical test files, one TS, one JS, and the JS ran fine. Does this make sense? |
Yes, which suggests that some code somewhere was not compiled down to CJS. The question is, was that your code, or a dependency? I'm happy to clarify in the README that this only works if the |
I think it was the import at the top of my test. I'll try to reproduce the situation again over the next couple of days and I get back to you |
Hey @novemberborn, check this simplified version of my project: https://github.com/adam-lynch/ava-typescript-import-issue. What am I missing? As far as I can tell everything is compiled down to CJS. This paragraph in this project's README has me wondering:
I.e. why the
|
Yes. The current state of In my projects, I have the tests files next to the source code, nested in a |
OK, so just to make sure I understand... you could not use this project, run |
Yes. But then you have to configure the |
Ha OK cool. I updated the PR to make it more clear but feel free to just close it, it might just be me |
No, it's valuable feedback, thank you. I've pushed some more edits. If you can put yourself back into yesterday's headspace, does that better describe what this package does? |
Definitely better. I wasn't sure about "while configuring AVA to use the TypeScript files" because they're not used. It makes AVA think it's using the TypeScript files, I guess. But having said that, the following paragraph makes it extra clear. Would this be incorrect? - while configuring AVA to use the TypeScript files
+ while configuring AVA to use the TypeScript paths |
Thanks for the feedback @adam-lynch! |
👍 |
Related to #5