docs: general updates and fixes (#13374)
* docs: general updates and fixes * fix lint errors
This commit is contained in:
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}
|
||||
/>
|
||||
Reference in new issue
Block a user