docs: fixes to testing tool guides (#8981)
This commit is contained in:
@@ -78,7 +78,9 @@ import { moduleIntegrationTestRunner } from "medusa-test-utils"
|
|||||||
import HelloModuleService from "../service"
|
import HelloModuleService from "../service"
|
||||||
import { model } from "@medusajs/utils"
|
import { model } from "@medusajs/utils"
|
||||||
|
|
||||||
const DummyModel = model.define("dummy_model", {})
|
const DummyModel = model.define("dummy_model", {
|
||||||
|
id: model.id().primaryKey()
|
||||||
|
})
|
||||||
|
|
||||||
moduleIntegrationTestRunner<HelloModuleService>({
|
moduleIntegrationTestRunner<HelloModuleService>({
|
||||||
moduleModels: [DummyModel],
|
moduleModels: [DummyModel],
|
||||||
|
|||||||
@@ -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`:
|
To use the `medusa-test-utils` package, install it as a `devDependency`:
|
||||||
|
|
||||||
```bash npm2yarn
|
```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: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: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>
|
<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>
|
</Note>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user