From 951b4a8100609fa9a67da20c0ad4609d3e052a09 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Wed, 4 Sep 2024 21:24:49 +0300 Subject: [PATCH] docs: fixes to testing tool guides (#8981) --- .../testing-tools/modules-tests/page.mdx | 4 +++- .../book/app/debugging-and-testing/testing-tools/page.mdx | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/www/apps/book/app/debugging-and-testing/testing-tools/modules-tests/page.mdx b/www/apps/book/app/debugging-and-testing/testing-tools/modules-tests/page.mdx index 9be6ef07fe..b9b01e37d2 100644 --- a/www/apps/book/app/debugging-and-testing/testing-tools/modules-tests/page.mdx +++ b/www/apps/book/app/debugging-and-testing/testing-tools/modules-tests/page.mdx @@ -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({ moduleModels: [DummyModel], diff --git a/www/apps/book/app/debugging-and-testing/testing-tools/page.mdx b/www/apps/book/app/debugging-and-testing/testing-tools/page.mdx index 33594e2a36..05734cf20a 100644 --- a/www/apps/book/app/debugging-and-testing/testing-tools/page.mdx +++ b/www/apps/book/app/debugging-and-testing/testing-tools/page.mdx @@ -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. -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.