Skip to content
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

limel-markdown: Add unit tests for markdownParser #3226

Open
3 tasks
adrianschmidt opened this issue Oct 4, 2024 · 0 comments
Open
3 tasks

limel-markdown: Add unit tests for markdownParser #3226

adrianschmidt opened this issue Oct 4, 2024 · 0 comments
Assignees

Comments

@adrianschmidt
Copy link
Contributor

adrianschmidt commented Oct 4, 2024

At the moment, we can't write tests for the markdownParser because it uses a package called unified, which is written in ESM (ES Modules), with no non-ESM build included in the package. We're using an old version of Jest, which can't handle ESM, and is so old that the experimental option for allowing ESM doesn't exist in it. Newer Jest versions have it.

One option is to configure Babel to transpile ESM to a non-ESM version, but a) I've tried that and couldn't get it to work without breaking loads of other things, and b) then we're technically not actually testing the code that we're running in the browser. (I guess that's already true for packages that have non-ESM builds included.)

The preferable option is to update Jest to a version that can handle ESM. We are currently using Stencil 3, which locks jest and jest-cli to major version 27. (The latest major version of each is 29.) So we need to upgrade to Stencil 4 in order to upgrade to a newer version of Jest.

There is already a branch for updating to Stencil 4, and that works just fine, except that Stencil 4 requires an update of Typescript from v4 to v5, which conflicts with the current version of Kompendium, so Kompendium needs to be updated to work with Typescript v5.

Stuff that seems to be necessary to do before we can test markdownParser

Preview Give feedback
  1. adrianschmidt
@adrianschmidt adrianschmidt self-assigned this Oct 4, 2024
@adrianschmidt adrianschmidt changed the title Add unit tests for markdownParser limel-markdown: Add unit tests for markdownParser Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant