You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The content you are editing has changed. Please copy your edits and refresh the page.
Stuff that seems to be necessary to do before we can test markdownParser
At the moment, we can't write tests for the
markdownParser
because it uses a package calledunified
, 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
andjest-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
The text was updated successfully, but these errors were encountered: