-
Notifications
You must be signed in to change notification settings - Fork 59
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
Running tests with a bundler should be easier #186
Comments
Webpack removes the need to glob for files, but a bundled file that requires test env CLI cannot be used with this package:
Ideally the core repo needs to add CLI argument for an absolute bin path to wrap the script JS. |
Yea, webpack would, though we would dislike 'hardcoding' to a single bundler. And I myself prefer esbuild for my extensions 🙂 There are solutions there too, of course, but the question is whether we want to maintain a list of instructions/plugins needed for each bundler (which is sure to change over time) |
Fwiw there is now bleeding edge BDD test closures shipped with node - Test runner (NodeJS). |
I’m trying to understand this problem. Is this correct? There are integration tests. These tests run test actual behaviour based on the generated bundle that ships with the VSCode extension. These do not require access to the source code. These integration tests are often written in TypeScript, but compiled and run as JavaScript. There’s no need to bundle tests for this. There are unittests. These test the source code on a lower level. Both the unittests and source code are often written in TypeScript, but compiled and run as JavaScript. This means tests need a compilation step which is different from the build step. So the real problem is extension tests can’t run TypeScript code, right? I imagine the ideal situation would be that the user just needs to write a standard test file, run I think this is possible by:
|
I have a working test suite that scales to Node and Web in a platform-independent manner:
|
Currently our standard test setup is using mocha and globbing for files. This doesn't work well with bundlers like esbuild or webpack. There are hacks to allow star imports in both these bundlers, but ideally we could figure some less-intrusive way to deal with these.
The text was updated successfully, but these errors were encountered: