fix(index): merge filterable fields schema (#12888)
This commit is contained in:
committed by
GitHub
parent
46bf7ae7ae
commit
fa76f85bba
@@ -1,3 +1,4 @@
|
||||
import { logger } from "@medusajs/framework/logger"
|
||||
import { MedusaAppOutput } from "@medusajs/framework/modules-sdk"
|
||||
import { MedusaContainer } from "@medusajs/framework/types"
|
||||
import {
|
||||
@@ -7,7 +8,6 @@ import {
|
||||
mergePluginModules,
|
||||
} from "@medusajs/framework/utils"
|
||||
import { asValue } from "awilix"
|
||||
import { logger } from "@medusajs/framework/logger"
|
||||
import { dbTestUtilFactory, getDatabaseURL } from "./database"
|
||||
import {
|
||||
applyEnvVarsToProcess,
|
||||
@@ -48,6 +48,9 @@ interface TestRunnerConfig {
|
||||
schema?: string
|
||||
debug?: boolean
|
||||
inApp?: boolean
|
||||
hooks?: {
|
||||
beforeServerStart?: (container: MedusaContainer) => Promise<void>
|
||||
}
|
||||
}
|
||||
|
||||
class MedusaTestRunner {
|
||||
@@ -72,6 +75,7 @@ class MedusaTestRunner {
|
||||
private loadedApplication: any = null
|
||||
private shutdown: () => Promise<void> = async () => void 0
|
||||
private isFirstTime = true
|
||||
private hooks: TestRunnerConfig["hooks"] = {}
|
||||
|
||||
constructor(config: TestRunnerConfig) {
|
||||
const tempName = parseInt(process.env.JEST_WORKER_ID || "1")
|
||||
@@ -93,6 +97,7 @@ class MedusaTestRunner {
|
||||
schema: this.schema,
|
||||
debug: this.debug,
|
||||
}
|
||||
this.hooks = config.hooks ?? {}
|
||||
|
||||
this.setupProcessHandlers()
|
||||
}
|
||||
@@ -158,6 +163,10 @@ class MedusaTestRunner {
|
||||
[ContainerRegistrationKeys.LOGGER]: asValue(logger),
|
||||
})
|
||||
|
||||
if (this.hooks?.beforeServerStart) {
|
||||
await this.hooks.beforeServerStart(container)
|
||||
}
|
||||
|
||||
await this.initializeDatabase()
|
||||
|
||||
logger.info(
|
||||
@@ -309,6 +318,7 @@ export function medusaIntegrationTestRunner({
|
||||
debug = false,
|
||||
inApp = false,
|
||||
testSuite,
|
||||
hooks,
|
||||
}: {
|
||||
moduleName?: string
|
||||
env?: Record<string, any>
|
||||
@@ -318,6 +328,7 @@ export function medusaIntegrationTestRunner({
|
||||
debug?: boolean
|
||||
inApp?: boolean
|
||||
testSuite: (options: MedusaSuiteOptions) => void
|
||||
hooks?: TestRunnerConfig["hooks"]
|
||||
}) {
|
||||
const runner = new MedusaTestRunner({
|
||||
moduleName,
|
||||
@@ -327,6 +338,7 @@ export function medusaIntegrationTestRunner({
|
||||
env,
|
||||
debug,
|
||||
inApp,
|
||||
hooks,
|
||||
})
|
||||
|
||||
return describe("", () => {
|
||||
|
||||
Reference in New Issue
Block a user