Skip to content

[Bug]: Cannot find module strapi from tests/helpers/strapi.js #671

@MaRo99382

Description

@MaRo99382

Link to the documentation page or resource

https://docs.strapi.io/developer-docs/latest/guides/unit-testing.html#install-test-tools

Describe the bug

When following the documentation on how to setup unit testing with a strapi instance, I get the following error when running npm run test:
image
It seems like the import of strapi has changed in the new version 4 and this is why it's not working?

Additional context

No response

Suggested improvements or fixes

Update the documentation to adjust for changes introduced in v4 of Strapi.

Related issue(s)/PR(s)

No response

Metadata

Metadata

Assignees

Labels

pr: fixUsed on the docs repo for anything that is not "new" or "updated" content: chore, typos, fixes, etc.status: pending reproductionWaiting for free time to reproduce the issue, or more information

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions