docs: fixes to testing tool guides (#8981)

This commit is contained in:
Shahed Nasser
2024-09-04 21:24:49 +03:00
committed by GitHub
parent 1d54e8fdc1
commit 951b4a8100
2 changed files with 6 additions and 4 deletions

View File

@@ -78,7 +78,9 @@ import { moduleIntegrationTestRunner } from "medusa-test-utils"
import HelloModuleService from "../service"
import { model } from "@medusajs/utils"
const DummyModel = model.define("dummy_model", {})
const DummyModel = model.define("dummy_model", {
id: model.id().primaryKey()
})
moduleIntegrationTestRunner<HelloModuleService>({
moduleModels: [DummyModel],

View File

@@ -15,7 +15,7 @@ Medusa provides a `medusa-test-utils` package with utility tools to create integ
To use the `medusa-test-utils` package, install it as a `devDependency`:
```bash npm2yarn
npm install --save-dev medusa-test-utils
npm install --save-dev medusa-test-utils@preview
```
---
@@ -88,11 +88,11 @@ You now have two commands:
- `test:integration:http` to run integration tests (for example, for API routes and workflows) available under the `integration-tests/http` directory.
- `test:integration:modules` to run integration tests for modules available in any `__tests__` directory under `src/modules`.
- `test:unit` to run unit tests in any `__tests` directory under the `src` directory.
- `test:unit` to run unit tests in any `__tests__` directory under the `src` directory.
<Note>
Unit tests aren't covered by Medusa's testing tools.
Medusa provides utility tools for integration tests only. You can write unit tests using Jest.
</Note>