Add tests for esm/cjs builds
Package
next-drupal (NPM package)
Describe the feature request
We currently test the src/ code by importing it into Jest and running the tests.
Debates of whether software tests should be run against source or built software are common. For example: https://softwareengineering.stackexchange.com/questions/296757/in-ci-should-tests-be-run-against-src-or-dist
Right now we have an experimental release that is broken and the Jest tests aren't catching it.
Describe the solution you'd like
Test both the source and the builds.
Additional context
There's a blog post describing how to toggle between source and builds using Jest. https://blog.pshrmn.com/jest-test-builds/
I just swapped the src files with the build files in our Jest tests and the Jest tests still aren't catching the broken build. :\