diff --git a/www/apps/book/app/learn/debugging-and-testing/page.mdx b/www/apps/book/app/learn/debugging-and-testing/page.mdx index 3af9252b31..689dc03520 100644 --- a/www/apps/book/app/learn/debugging-and-testing/page.mdx +++ b/www/apps/book/app/learn/debugging-and-testing/page.mdx @@ -8,5 +8,5 @@ In the next chapters, you’ll learn about the tools Medusa provides for testing By the end of this chapter, you’ll learn: -- How to use Medusa's `medusa-test-utils` test to write integration tests. +- How to use Medusa's `@medusajs/test-utils` test to write integration tests. - How to use Medusa’s `Logger` utility to log messages. diff --git a/www/apps/book/app/learn/debugging-and-testing/testing-tools/integration-tests/api-routes/page.mdx b/www/apps/book/app/learn/debugging-and-testing/testing-tools/integration-tests/api-routes/page.mdx index 8459c5b5b9..80fc794f04 100644 --- a/www/apps/book/app/learn/debugging-and-testing/testing-tools/integration-tests/api-routes/page.mdx +++ b/www/apps/book/app/learn/debugging-and-testing/testing-tools/integration-tests/api-routes/page.mdx @@ -41,7 +41,7 @@ export const getHighlights = [ ] ```ts title="integration-tests/http/custom-routes.spec.ts" highlights={getHighlights} -import { medusaIntegrationTestRunner } from "medusa-test-utils" +import { medusaIntegrationTestRunner } from "@medusajs/test-utils" medusaIntegrationTestRunner({ testSuite: ({ api, getContainer }) => { diff --git a/www/apps/book/app/learn/debugging-and-testing/testing-tools/integration-tests/page.mdx b/www/apps/book/app/learn/debugging-and-testing/testing-tools/integration-tests/page.mdx index 30c658dd2f..450447fab6 100644 --- a/www/apps/book/app/learn/debugging-and-testing/testing-tools/integration-tests/page.mdx +++ b/www/apps/book/app/learn/debugging-and-testing/testing-tools/integration-tests/page.mdx @@ -19,7 +19,7 @@ In this chapter, you'll learn about the `medusaIntegrationTestRunner` utility fu ## medusaIntegrationTestRunner Utility -The `medusaIntegrationTestRunner` utility function is provided by the `medusa-test-utils` package to create integration tests in your Medusa project. It runs a full Medusa application, allowing you test API routes, workflows, or other customizations. +The `medusaIntegrationTestRunner` utility function is provided by the `@medusajs/test-utils` package to create integration tests in your Medusa project. It runs a full Medusa application, allowing you test API routes, workflows, or other customizations. For example: @@ -29,7 +29,7 @@ export const highlights = [ ] ```ts title="integration-tests/http/test.spec.ts" highlights={highlights} -import { medusaIntegrationTestRunner } from "medusa-test-utils" +import { medusaIntegrationTestRunner } from "@medusajs/test-utils" medusaIntegrationTestRunner({ testSuite: ({ api, getContainer }) => { diff --git a/www/apps/book/app/learn/debugging-and-testing/testing-tools/integration-tests/workflows/page.mdx b/www/apps/book/app/learn/debugging-and-testing/testing-tools/integration-tests/workflows/page.mdx index 3895378754..0aec5b27c1 100644 --- a/www/apps/book/app/learn/debugging-and-testing/testing-tools/integration-tests/workflows/page.mdx +++ b/www/apps/book/app/learn/debugging-and-testing/testing-tools/integration-tests/workflows/page.mdx @@ -46,7 +46,7 @@ export const helloWorldWorkflow = createWorkflow( To write a test for this workflow, create the file `integration-tests/http/workflow.spec.ts` with the following content: ```ts title="integration-tests/http/workflow.spec.ts" -import { medusaIntegrationTestRunner } from "medusa-test-utils" +import { medusaIntegrationTestRunner } from "@medusajs/test-utils" import { helloWorldWorkflow } from "../../src/workflows/hello-world" medusaIntegrationTestRunner({ diff --git a/www/apps/book/app/learn/debugging-and-testing/testing-tools/modules-tests/module-example/page.mdx b/www/apps/book/app/learn/debugging-and-testing/testing-tools/modules-tests/module-example/page.mdx index 48f828aa2a..e88c4811c0 100644 --- a/www/apps/book/app/learn/debugging-and-testing/testing-tools/modules-tests/module-example/page.mdx +++ b/www/apps/book/app/learn/debugging-and-testing/testing-tools/modules-tests/module-example/page.mdx @@ -39,7 +39,7 @@ export default HelloModuleService To create an integration test for the method, create the file `src/modules/hello/__tests__/service.spec.ts` with the following content: ```ts title="src/modules/hello/__tests__/service.spec.ts" -import { moduleIntegrationTestRunner } from "medusa-test-utils" +import { moduleIntegrationTestRunner } from "@medusajs/test-utils" import { HELLO_MODULE } from ".." import HelloModuleService from "../service" import MyCustom from "../models/my-custom" diff --git a/www/apps/book/app/learn/debugging-and-testing/testing-tools/modules-tests/page.mdx b/www/apps/book/app/learn/debugging-and-testing/testing-tools/modules-tests/page.mdx index 4464c0f0d5..c0229a41b3 100644 --- a/www/apps/book/app/learn/debugging-and-testing/testing-tools/modules-tests/page.mdx +++ b/www/apps/book/app/learn/debugging-and-testing/testing-tools/modules-tests/page.mdx @@ -19,12 +19,12 @@ In this chapter, you'll learn about the `moduleIntegrationTestRunner` utility fu ## moduleIntegrationTestRunner Utility -The `moduleIntegrationTestRunner` utility function is provided by the `medusa-test-utils` package to create integration tests for a module. The integration tests run on a test Medusa application with only the specified module enabled. +The `moduleIntegrationTestRunner` utility function is provided by the `@medusajs/test-utils` package to create integration tests for a module. The integration tests run on a test Medusa application with only the specified module enabled. For example, assuming you have a `hello` module, create a test file at `src/modules/hello/__tests__/service.spec.ts`: ```ts title="src/modules/hello/__tests__/service.spec.ts" -import { moduleIntegrationTestRunner } from "medusa-test-utils" +import { moduleIntegrationTestRunner } from "@medusajs/test-utils" import { HELLO_MODULE } from ".." import HelloModuleService from "../service" import MyCustom from "../models/my-custom" @@ -83,7 +83,7 @@ If your module accepts options, you can set them using the `moduleOptions` prope For example: ```ts -import { moduleIntegrationTestRunner } from "medusa-test-utils" +import { moduleIntegrationTestRunner } from "@medusajs/test-utils" import HelloModuleService from "../service" moduleIntegrationTestRunner({ @@ -103,7 +103,7 @@ If your module doesn't have a data model, pass a dummy model in the `moduleModel For example: ```ts -import { moduleIntegrationTestRunner } from "medusa-test-utils" +import { moduleIntegrationTestRunner } from "@medusajs/test-utils" import HelloModuleService from "../service" import { model } from "@medusajs/framework/utils" diff --git a/www/apps/book/app/learn/debugging-and-testing/testing-tools/page.mdx b/www/apps/book/app/learn/debugging-and-testing/testing-tools/page.mdx index 1fe81dfaec..a7fdb8d9bc 100644 --- a/www/apps/book/app/learn/debugging-and-testing/testing-tools/page.mdx +++ b/www/apps/book/app/learn/debugging-and-testing/testing-tools/page.mdx @@ -6,23 +6,23 @@ export const metadata = { In this chapter, you'll learn about Medusa's testing tools and how to install and configure them. -## medusa-test-utils Package +## @medusajs/test-utils Package -Medusa provides a `medusa-test-utils` package with utility tools to create integration tests for your custom API routes, modules, or other Medusa customizations. +Medusa provides a `@medusajs/test-utils` package with utility tools to create integration tests for your custom API routes, modules, or other Medusa customizations. -### Install medusa-test-utils +### Install @medusajs/test-utils -To use the `medusa-test-utils` package, install it as a `devDependency`: +To use the `@medusajs/test-utils` package, install it as a `devDependency`: ```bash npm2yarn -npm install --save-dev medusa-test-utils@rc +npm install --save-dev @medusajs/test-utils@rc ``` --- ## Install and Configure Jest -Writing tests with `medusa-test-utils`'s tools requires installing and configuring Jest in your project. +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 */} @@ -100,4 +100,4 @@ Medusa provides utility tools for integration tests only. You can write unit tes ## Test Tools and Writing Tests -The next chapters explain how to use the testing tools provided by `medusa-test-utils` to write tests. +The next chapters explain how to use the testing tools provided by `@medusajs/test-utils` to write tests. diff --git a/www/apps/resources/app/architectural-modules/file/local/page.mdx b/www/apps/resources/app/architectural-modules/file/local/page.mdx index 9ff2171657..7a16583d43 100644 --- a/www/apps/resources/app/architectural-modules/file/local/page.mdx +++ b/www/apps/resources/app/architectural-modules/file/local/page.mdx @@ -45,7 +45,7 @@ module.exports = { options: { providers: [ { - resolve: "@medusajs/medusa/file-local-next", + resolve: "@medusajs/medusa/file-local", id: "local", options: { // provider options... diff --git a/www/apps/resources/app/commerce-modules/inventory/examples/page.mdx b/www/apps/resources/app/commerce-modules/inventory/examples/page.mdx index abc9823411..4877b4caf0 100644 --- a/www/apps/resources/app/commerce-modules/inventory/examples/page.mdx +++ b/www/apps/resources/app/commerce-modules/inventory/examples/page.mdx @@ -47,7 +47,7 @@ export async function POST( ```ts import { NextResponse } from "next/server" -import { initialize as initializeInventoryModule } from "@medusajs/medusa/inventory-next" +import { initialize as initializeInventoryModule } from "@medusajs/medusa/inventory" export async function POST(request: Request) { const inventoryModuleService = await initializeInventoryModule({}) @@ -97,7 +97,7 @@ export async function GET( ```ts import { NextResponse } from "next/server" -import { initialize as initializeInventoryModule } from "@medusajs/medusa/inventory-next" +import { initialize as initializeInventoryModule } from "@medusajs/medusa/inventory" export async function GET(request: Request) { const inventoryModuleService = await initializeInventoryModule({}) @@ -144,7 +144,7 @@ export async function GET( ```ts import { NextResponse } from "next/server" -import { initialize as initializeInventoryModule } from "@medusajs/medusa/inventory-next" +import { initialize as initializeInventoryModule } from "@medusajs/medusa/inventory" type ContextType = { params: { @@ -201,7 +201,7 @@ export async function POST( ```ts import { NextResponse } from "next/server" -import { initialize as initializeInventoryModule } from "@medusajs/medusa/inventory-next" +import { initialize as initializeInventoryModule } from "@medusajs/medusa/inventory" export async function POST(request: Request) { const inventoryModuleService = await initializeInventoryModule({}) @@ -255,7 +255,7 @@ export async function POST( ```ts import { NextResponse } from "next/server" -import { initialize as initializeInventoryModule } from "@medusajs/medusa/inventory-next" +import { initialize as initializeInventoryModule } from "@medusajs/medusa/inventory" export async function POST(request: Request) { const inventoryModuleService = await initializeInventoryModule({}) @@ -309,7 +309,7 @@ export async function POST( ```ts import { NextResponse } from "next/server" -import { initialize as initializeInventoryModule } from "@medusajs/medusa/inventory-next" +import { initialize as initializeInventoryModule } from "@medusajs/medusa/inventory" export async function POST(request: Request) { const inventoryModuleService = await initializeInventoryModule({}) @@ -363,7 +363,7 @@ export async function POST( ```ts import { NextResponse } from "next/server" -import { initialize as initializeInventoryModule } from "@medusajs/medusa/inventory-next" +import { initialize as initializeInventoryModule } from "@medusajs/medusa/inventory" export async function POST(request: Request) { const inventoryModuleService = await initializeInventoryModule({}) @@ -432,7 +432,7 @@ export async function GET( ```ts import { NextResponse } from "next/server" -import { initialize as initializeInventoryModule } from "@medusajs/medusa/inventory-next" +import { initialize as initializeInventoryModule } from "@medusajs/medusa/inventory" type ContextType = { params: { @@ -501,7 +501,7 @@ export async function DELETE( ```ts -import { initialize as initializeInventoryModule } from "@medusajs/medusa/inventory-next" +import { initialize as initializeInventoryModule } from "@medusajs/medusa/inventory" type ContextType = { params: { diff --git a/www/apps/resources/app/commerce-modules/stock-location/examples/page.mdx b/www/apps/resources/app/commerce-modules/stock-location/examples/page.mdx index b7efd041db..e530c4f797 100644 --- a/www/apps/resources/app/commerce-modules/stock-location/examples/page.mdx +++ b/www/apps/resources/app/commerce-modules/stock-location/examples/page.mdx @@ -46,7 +46,7 @@ export async function POST( ```ts import { NextResponse } from "next/server" -import { initialize as initializeStockLocationModule } from "@medusajs/medusa/stock-location-next" +import { initialize as initializeStockLocationModule } from "@medusajs/medusa/stock-location" export async function POST(request: Request) { const stockLocationModuleService = await initializeStockLocationModule({}) @@ -92,7 +92,7 @@ export async function GET( ```ts import { NextResponse } from "next/server" -import { initialize as initializeStockLocationModule } from "@medusajs/medusa/stock-location-next" +import { initialize as initializeStockLocationModule } from "@medusajs/medusa/stock-location" export async function GET(request: Request) { const stockLocationModuleService = await initializeStockLocationModule({}) @@ -146,7 +146,7 @@ export async function POST( ```ts import { NextResponse } from "next/server" -import { initialize as initializeStockLocationModule } from "@medusajs/medusa/stock-location-next" +import { initialize as initializeStockLocationModule } from "@medusajs/medusa/stock-location" export async function POST(request: Request) { const stockLocationModuleService = await initializeStockLocationModule({}) @@ -200,7 +200,7 @@ export async function DELETE( ```ts import { NextResponse } from "next/server" -import { initialize as initializeStockLocationModule } from "@medusajs/medusa/stock-location-next" +import { initialize as initializeStockLocationModule } from "@medusajs/medusa/stock-location" export async function DELETE(request: Request) { const stockLocationModuleService = await initializeStockLocationModule({}) diff --git a/www/apps/resources/app/contribution-guidelines/docs/page.mdx b/www/apps/resources/app/contribution-guidelines/docs/page.mdx index a7a28ae3d2..92d31938d2 100644 --- a/www/apps/resources/app/contribution-guidelines/docs/page.mdx +++ b/www/apps/resources/app/contribution-guidelines/docs/page.mdx @@ -119,7 +119,7 @@ The code snippet must be written using NPM. When a command uses the global option `-g`, add it at the end of the NPM command to ensure that it’s transformed to a Yarn command properly. For example: ```bash npm2yarn -npm install @medusajs/medusa-cli -g +npm install @medusajs/cli -g ``` --- diff --git a/www/apps/resources/app/examples/page.mdx b/www/apps/resources/app/examples/page.mdx index bc265f7ec7..eda0a89feb 100644 --- a/www/apps/resources/app/examples/page.mdx +++ b/www/apps/resources/app/examples/page.mdx @@ -3230,7 +3230,7 @@ Learn more in [this documentation](!docs!/advanced-development/admin/tips#routin ## Integration Tests -Medusa provides a `medusa-test-utils` package with utility tools to create integration tests for your custom API routes, modules, or other Medusa customizations. +Medusa provides a `@medusajs/test-utils` package with utility tools to create integration tests for your custom API routes, modules, or other Medusa customizations. @@ -3243,7 +3243,7 @@ For details on setting up your project for integration tests, refer to [this doc To create a test for a custom API route, create the file `integration-tests/http/custom-routes.spec.ts` with the following content: ```ts title="integration-tests/http/custom-routes.spec.ts" -import { medusaIntegrationTestRunner } from "medusa-test-utils" +import { medusaIntegrationTestRunner } from "@medusajs/test-utils" medusaIntegrationTestRunner({ testSuite: ({ api, getContainer }) => { @@ -3277,7 +3277,7 @@ Learn more in [this documentation](!docs!/debugging-and-testing/testing-tools/in To create a test for a workflow, create the file `integration-tests/http/workflow.spec.ts` with the following content: ```ts title="integration-tests/http/workflow.spec.ts" -import { medusaIntegrationTestRunner } from "medusa-test-utils" +import { medusaIntegrationTestRunner } from "@medusajs/test-utils" import { helloWorldWorkflow } from "../../src/workflows/hello-world" medusaIntegrationTestRunner({ @@ -3309,7 +3309,7 @@ To create a test for a module's service, create the test under the `__tests__` d For example, create the file `src/modules/hello/__tests__/service.spec.ts` with the following content: ```ts title="src/modules/hello/__tests__/service.spec.ts" -import { moduleIntegrationTestRunner } from "medusa-test-utils" +import { moduleIntegrationTestRunner } from "@medusajs/test-utils" import { HELLO_MODULE } from ".." import HelloModuleService from "../service" import MyCustom from "../models/my-custom" diff --git a/www/apps/resources/app/test-tools-reference/medusaIntegrationTestRunner/page.mdx b/www/apps/resources/app/test-tools-reference/medusaIntegrationTestRunner/page.mdx index 84e0d6dbf6..f9642ef9cf 100644 --- a/www/apps/resources/app/test-tools-reference/medusaIntegrationTestRunner/page.mdx +++ b/www/apps/resources/app/test-tools-reference/medusaIntegrationTestRunner/page.mdx @@ -6,12 +6,12 @@ export const metadata = { # {metadata.title} -This document provides a reference to the `medusaIntegrationTestRunner` function provided by the `medusa-test-utils` package. +This document provides a reference to the `medusaIntegrationTestRunner` function provided by the `@medusajs/test-utils` package. ## Example ```ts -import { medusaIntegrationTestRunner } from "medusa-test-utils" +import { medusaIntegrationTestRunner } from "@medusajs/test-utils" medusaIntegrationTestRunner({ testSuite: ({ api, getContainer }) => { diff --git a/www/apps/resources/app/test-tools-reference/moduleIntegrationTestRunner/page.mdx b/www/apps/resources/app/test-tools-reference/moduleIntegrationTestRunner/page.mdx index 58bdbd8a11..f6e27ee6b3 100644 --- a/www/apps/resources/app/test-tools-reference/moduleIntegrationTestRunner/page.mdx +++ b/www/apps/resources/app/test-tools-reference/moduleIntegrationTestRunner/page.mdx @@ -6,12 +6,12 @@ export const metadata = { # {metadata.title} -This document provides a reference to the `moduleIntegrationTestRunner` function provided by the `medusa-test-utils` package. +This document provides a reference to the `moduleIntegrationTestRunner` function provided by the `@medusajs/test-utils` package. ## Example ```ts -import { moduleIntegrationTestRunner } from "medusa-test-utils" +import { moduleIntegrationTestRunner } from "@medusajs/test-utils" import { HELLO_MODULE } from ".." import HelloModuleService from "../service" import MyCustom from "../models/my-custom" diff --git a/www/apps/resources/app/test-tools-reference/page.mdx b/www/apps/resources/app/test-tools-reference/page.mdx index 62068c3a08..2e21d3ed48 100644 --- a/www/apps/resources/app/test-tools-reference/page.mdx +++ b/www/apps/resources/app/test-tools-reference/page.mdx @@ -6,6 +6,6 @@ export const metadata = { # {metadata.title} -This section of the documentation provides a reference to the testing functions provided by the `medusa-test-utils` package. +This section of the documentation provides a reference to the testing functions provided by the `@medusajs/test-utils` package. \ No newline at end of file diff --git a/www/apps/resources/generated/edit-dates.mjs b/www/apps/resources/generated/edit-dates.mjs index 383ddae287..5c18b7f60c 100644 --- a/www/apps/resources/generated/edit-dates.mjs +++ b/www/apps/resources/generated/edit-dates.mjs @@ -114,7 +114,7 @@ export const generatedEditDates = { "app/commerce-modules/user/page.mdx": "2024-10-15T14:44:19.628Z", "app/commerce-modules/page.mdx": "2024-10-07T13:55:08.014Z", "app/contribution-guidelines/_admin-translations/page.mdx": "2024-05-13T18:55:11+03:00", - "app/contribution-guidelines/docs/page.mdx": "2024-05-13T18:55:11+03:00", + "app/contribution-guidelines/docs/page.mdx": "2024-10-16T15:48:04.071Z", "app/create-medusa-app/page.mdx": "2024-08-05T11:10:55+03:00", "app/deployment/admin/vercel/page.mdx": "2024-10-16T08:10:29.377Z", "app/deployment/medusa-application/railway/page.mdx": "2024-10-15T12:50:50.981Z", @@ -230,7 +230,7 @@ export const generatedEditDates = { "app/architectural-modules/workflow-engine/in-memory/page.mdx": "2024-10-15T12:50:57.249Z", "app/architectural-modules/cache/in-memory/page.mdx": "2024-10-15T12:49:57.608Z", "app/architectural-modules/notification/local/page.mdx": "2024-10-15T12:51:21.284Z", - "app/architectural-modules/file/local/page.mdx": "2024-10-15T12:51:07.033Z", + "app/architectural-modules/file/local/page.mdx": "2024-10-16T15:48:42.839Z", "app/architectural-modules/notification/send-notification/page.mdx": "2024-09-30T08:43:53.151Z", "app/architectural-modules/file/page.mdx": "2024-07-01T10:21:19+03:00", "app/architectural-modules/event/page.mdx": "2024-05-28T13:25:03+03:00", @@ -753,9 +753,9 @@ export const generatedEditDates = { "references/types/HttpTypes/interfaces/types.HttpTypes.AdminWorkflowExecution/page.mdx": "2024-08-30T00:11:02.510Z", "references/types/HttpTypes/interfaces/types.HttpTypes.AdminWorkflowExecutionResponse/page.mdx": "2024-08-30T00:11:02.514Z", "references/types/interfaces/types.BaseReturnItem/page.mdx": "2024-08-30T00:11:02.538Z", - "app/test-tools-reference/medusaIntegrationTestRunner/page.mdx": "2024-09-02T12:12:48.492Z", - "app/test-tools-reference/moduleIntegrationTestRunner/page.mdx": "2024-10-16T08:52:30.701Z", - "app/test-tools-reference/page.mdx": "2024-09-02T12:25:44.922Z", + "app/test-tools-reference/medusaIntegrationTestRunner/page.mdx": "2024-10-16T15:47:38.579Z", + "app/test-tools-reference/moduleIntegrationTestRunner/page.mdx": "2024-10-16T15:47:38.504Z", + "app/test-tools-reference/page.mdx": "2024-10-16T15:47:38.429Z", "references/types/HttpTypes/interfaces/types.HttpTypes.AdminGetInvitesParams/page.mdx": "2024-09-03T00:10:55.319Z", "references/types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryLevel/page.mdx": "2024-09-17T00:10:58.487Z", "references/types/HttpTypes/interfaces/types.HttpTypes.BaseAddress/page.mdx": "2024-09-03T00:10:55.003Z", @@ -2290,7 +2290,7 @@ export const generatedEditDates = { "app/commerce-modules/sales-channel/links-to-other-modules/page.mdx": "2024-10-15T14:25:29.097Z", "app/commerce-modules/stock-location/links-to-other-modules/page.mdx": "2024-10-15T14:33:11.483Z", "app/commerce-modules/store/links-to-other-modules/page.mdx": "2024-06-26T07:19:49.931Z", - "app/examples/page.mdx": "2024-10-15T12:19:18.820Z", + "app/examples/page.mdx": "2024-10-16T15:47:38.345Z", "app/medusa-cli/commands/build/page.mdx": "2024-10-16T08:16:27.618Z", "app/js-sdk/page.mdx": "2024-10-16T12:12:34.512Z" } \ No newline at end of file