docs: fixes and improvements to testing docs (#11244)

* docs: fixes and improvements to testing docs

* generate files
This commit is contained in:
Shahed Nasser
2025-01-31 15:36:20 +02:00
committed by GitHub
parent 105e73b523
commit d6480c4d0a
12 changed files with 224 additions and 38 deletions
@@ -22,14 +22,6 @@ npm install --save-dev @medusajs/test-utils@latest
Writing tests with `@medusajs/test-utils`'s tools requires installing and configuring Jest in your project.
{/* TODO remove this note at some point in the future */}
<Note>
If your Medusa project was created after September 3rd, Jest is already installed and configured.
</Note>
Run the following command to install the required Jest dependencies:
```bash npm2yarn
@@ -56,6 +48,7 @@ module.exports = {
testEnvironment: "node",
moduleFileExtensions: ["js", "ts", "json"],
modulePathIgnorePatterns: ["dist/"],
setupFiles: ["./integration-tests/setup.js"],
}
if (process.env.TEST_TYPE === "integration:http") {
@@ -67,6 +60,14 @@ if (process.env.TEST_TYPE === "integration:http") {
}
```
Next, create the `integration-tests/setup.js` file with the following content:
```js title="integration-tests/setup.js"
const { MetadataStorage } = require("@mikro-orm/core")
MetadataStorage.clear()
```
---
## Add Test Commands