Replies: 1 comment 4 replies
-
Note though that this only impacts the test files themselves, which does suit your use case. For other approaches loader hooks are more appropriate. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using AVA for unit tests and it has worked great so far. Now I wanted to add integration tests, but AVA (or Node.js rather) chokes on
.sql
imports. I import.sql
migration files using the esbuildtext
loader. This way I end up with a single bundle and faster startup time (Electron).I'm sure there are multiple ways to work my way around this, e.g. having my tests as
*.build.test.js
, ignore them in AVA config and have an esbuild process output bundled.test.js
files without thebuild
part, which AVA will pick up. But that doesn't sound fun. What does sound fun would be something like this:I assume other bundlers could use this interface in a similar fashion and transforms could be provided for ts and whatnot.
From what I can tell right now there is no unified way to do things. And I'm definitely not going to try to integrate babel to do something that esbuild is already doing for my actual code. To me this looks cleaner than any of ts-node, babel, require-hooks, --experimental-loader and whatnot.
Beta Was this translation helpful? Give feedback.
All reactions