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
So -- like -- where do I put my test files as .ts? #2460
Comments
Found this: https://github.com/avajs/ava/blob/master/docs/recipes/typescript.md Where do the files go and how do they run? |
Found this: https://github.com/avajs/typescript I don't get it. I need to update package.json? If I'm not installing anything, couldn't ava just figure out that the files end in |
What is this:
why would I rewrite a path. Everything is where it's supposed to be. I'm not trying to hack something together here. Is this the default? |
I found this code in one of my old projects:
It's totally different than what I'm finding in your docs but at least looks reasonable. |
I tried a bunch more stuff but finally got it. Holy fuck you guys, it's like two lines of instructions:
I don't know if this is a bug or feature request issue, but could you add these instructions to your docs WAY UP at the top. It's insane how difficult this is for being --- for better or worse -- an industry standard. Sorry for being impatient. |
There's no special place where you need to place your files.
|
Ah, that makes a lot of sense. I use a typescript bundler, which skips the .js file output stage entirely. |
Could you elaborate on that? |
This is the bundler: https://github.com/fuse-box/fuse-box One can direct it at a root file and it will proceed to compile it and all of its dependencies into a single .js file. It also does fancy stuff like tree shaking unneeded code. So it does output a .js file, but not the way that |
Does your bundle include the tests? Presumably it includes everything else, right? So then in your tests you'd import the bundle? |
My bundle does not include the tests, and I'd never thought of running the tests using the bundle as the source. I prefer to use .ts files for everything I can as they're much more inspectable. It's nice to be able to meta-click and see the source code of any given thing. When using AVA, I currently just do it the slow way above. It's still plenty fast, so that's good. |
Ever heard of the drunk test? It's a UX thing where you see if a person can figure it out when drunk: Facebook passes... so does Paypal.
I can't figure out how to make my
/__tests/tets.ts
file to run withava
. I think maybe I'm supposed to do something extra for ava to work with .ts files... it's been a month or two. This probably should be on the landing page. I don't know many professionals who don't use typescript, to be frank.Cheers.
The text was updated successfully, but these errors were encountered: