docs: general updates and fixes (#13374)

* docs: general updates and fixes

* fix lint errors
This commit is contained in:
Shahed Nasser authored and GitHub committed 2025-09-02 09:07:07 +03:00
1 parent c717535ca2
commit 24199fa47a
25 files changed
+477 -396

No files matched your search

@@ -6,7 +6,7 @@ export const metadata = {
# {metadata.title}
This document provides a reference to the `medusaIntegrationTestRunner` function provided by the `@medusajs/test-utils` package.
This is a reference to the `medusaIntegrationTestRunner` function provided by the `@medusajs/test-utils` package.
## Example
@@ -30,36 +30,69 @@ medusaIntegrationTestRunner({
description: "Object parameter of test options.",
children: [
{
type: "`() => void`",
type: "`(options: MedusaSuiteOptions) => void`",
name: "testSuite",
description: "The Jest tests to run.",
optional: false
description: "The Jest tests to run. It accepts [Test Suite Parameters](#test-suite-parameters)",
},
{
type: "`string`",
name: "dbName",
description: "A name to use for the database. By default, a random name is generated.",
description: "A name to use for the database. If not specified, the database name will be of the format `medusa-<moduleName>-integration-<randomNumber>`.",
optional: true
},
{
type: "`string`",
name: "schema",
description: "The PostgreSQL schema that the database is created in.",
defaultValue: "public",
optional: true
},
{
type: "`Record<string, any>`",
name: "env",
description: "Environment variables to use in the test suite."
description: "Environment variables to pass to the test suite.",
optional: true
},
{
type: "`boolean`",
name: "debug",
description: "Whether to show database log messages.",
defaultValue: "false"
defaultValue: "false",
optional: true
},
{
type: "`string`",
name: "moduleName",
description: "The name of the module being tested. If not specified, a random name will be generated.",
optional: true
},
{
type: "`string`",
name: "medusaConfigFile",
description: "The path to the `medusa-config.ts` file, excluding `medusa-config.ts`. This path is used as the current working directory as well.",
defaultValue: "cwd (current working directory)",
optional: true
},
{
type: "`object`",
name: "hooks",
description: "An object containing hooks to run at different points in the test lifecycle.",
optional: true,
children: [
{
type: "`(container: MedusaContainer) => Promise<void>`",
name: "beforeServerStart",
description: "A hook that runs before the Medusa server starts.",
optional: true
}
]
}
]
}
]}
openedLevel={2}
sectionTitle="Parameters"
/>
## Test Suite Parameters
@@ -99,7 +132,7 @@ The function passed to `testSuite` accepts the following parameters:
{
type: "`() => MedusaContainer`",
name: "getContainer",
description: "A name to use for the database. By default, a random name is generated.",
description: "A function that returns the Medusa container.",
},
{
type: "`Record<string, string>`",
@@ -144,9 +177,22 @@ The function passed to `testSuite` accepts the following parameters:
description: "Drops a database."
},
]
},
{
type: "`object`",
name: "utils",
description: "A set of utility functions for the test suite.",
children: [
{
type: "`() => Promise<void>`",
name: "waitWorkflowExecutions",
description: "Waits for all workflow executions to complete."
}
]
}
]
}
]}
sectionTitle="Test Suite Parameters"
openedLevel={2}
/>
@@ -6,7 +6,7 @@ export const metadata = {
# {metadata.title}
This document provides a reference to the `moduleIntegrationTestRunner` function provided by the `@medusajs/test-utils` package.
This is a reference to the `moduleIntegrationTestRunner` function provided by the `@medusajs/test-utils` package.
## Example
@@ -39,51 +39,59 @@ moduleIntegrationTestRunner<BlogModuleService>({
type: "`string`",
name: "moduleName",
description: "The module's name.",
optional: false
},
{
type: "DmlEntity[]",
name: "moduleModels",
description: "The module's data models.",
optional: false
},
{
type: "string",
name: "resolve",
description: "The path to the module relative to the `src` directory.",
optional: false
},
{
type: "`() => void`",
name: "testSuite",
description: "The Jest tests to run.",
optional: false
},
{
type: "DmlEntity[]",
name: "moduleModels",
description: "The module's data models.",
optional: true
},
{
type: "`Record<string, any>`",
name: "moduleOptions",
description: "Options to pass to the module.",
optional: true
},
{
type: "`Record<string, any>`",
name: "injectedDependencies",
description: "Dependencies to inject into the module's container. They key is the registration name, and the value is the instance of the dependency.",
description: "Dependencies to inject into the module's container. The key is the registration name, and the value is the instance of the dependency.",
optional: true
},
{
type: "`string`",
name: "schema",
description: "The PostgreSQL schema that the database is created in.",
optional: true
},
{
type: "`boolean`",
name: "debug",
description: "Whether to show database log messages.",
defaultValue: "false"
defaultValue: "false",
optional: true
},
{
type: "`string`",
name: "cwd",
description: "The current working directory. If not set, the directory that you run the test command from is considered the current working directory.",
optional: true
}
]
}
]}
sectionTitle="Parameters"
openedLevel={2}
/>
## Test Suite Parameters
@@ -151,4 +159,5 @@ The function passed to `testSuite` accepts the following parameters:
}
]}
sectionTitle="Test Suite Parameters"
openedLevel={2}
/>