Test Errors

Loaders for module Workflows failed#

If you get the following error when running your tests:

Terminal
Loaders for module Workflows failed: Method Map.prototype.set called on incompatible receiver #<Map>

This may occur if you have multiple test files and you don't configure your Jest environment correctly. To resolve this, add the following configuration to your jest.config.js file:

jest.config.js
1module.exports = {2  // ...3  setupFiles: ["./integration-tests/setup.js"],4}

Then, create the integration-tests/setup.js file with the following content:

integration-tests/setup.js
1const { MetadataStorage } = require("@mikro-orm/core")2
3MetadataStorage.clear()

Learn more about configuring test tools in this documentation

Was this page helpful?
Edit this page
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break