Prevent transpiled JS issues - minimal node test in CI?
Opened this issue · 2 comments
I just spent a bunch of hours fixing #270, which occured because all the created JS files actually didn't work. I never noticed before, because I only used typescript projects, or used transpilers that resolved modules correctly.
Also, some time ago, I noticed that @tomic/lib
didn't work in a NodeJS context, because I used some browser APIs.
I want to prevent these types of issues. I want the CI to fail. I added some tsconfig and eslint rules to help prevent the issues from above, but I feel like an even better solution is to run the compiled JS in a node context and do something simple. EDIT: This won't even have caught this issue, as node correctly resolves these extensions.
Other suggestions are welcome, too!
The non-e2e tests are already running in a node context, so basically the only thing I might still want to add is a test for the compiled js code. Maybe this could be something extremely minimal. It should be run as part of the CI. Ideally, updating the version of an NPM package is also a CI action instead of me running CLI commands locally.