next-drupal icon indicating copy to clipboard operation
next-drupal copied to clipboard

Add tests for esm/cjs builds

Open JohnAlbin opened this issue 2 years ago • 1 comments

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/

JohnAlbin avatar Nov 15 '23 18:11 JohnAlbin

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. :\

JohnAlbin avatar Nov 15 '23 18:11 JohnAlbin