When configuring Jest to transform .mdx stories and testing with Storyshots, I get the following error:
Error: ● Invalid synchronous transformer module:
"/Users/btepe/Documents/camunda/projects/camunda-composite-components/node_modules/@storybook/addon-docs/jest-transform-mdx.js" specified in the "transform" object of Jest configuration
must export a `process` function.
Code Transformation Documentation:
https://jestjs.io/docs/code-transformation
If your codebase is ESM only, implementing the async variants are sufficient. Otherwise, if any code is loaded through require (including createRequire from within ESM), then you need to implement the synchronous process variant.
The transformer provided by the docs addon either needs to use import instead of require or define a process method.
Describe the bug
When configuring Jest to transform
.mdx
stories and testing with Storyshots, I get the following error:According to the Jest docs, this is due to the transformer in jest-transform-mdx.js using
require
and therefore not using the ESM syntax:The transformer provided by the docs addon either needs to use
import
instead ofrequire
or define aprocess
method.To Reproduce
No response
System
Additional context
No response