chore: add workaround for unsettled top-level await script failures (#8467)

currently only for pnpm dev
This commit is contained in:
Alessio Gravili
2024-09-28 13:53:45 -04:00
committed by GitHub
parent 8b44676b0d
commit e7b44dc545
2 changed files with 52 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ import { loadEnv } from 'payload/node'
import { getNextRootDir } from './helpers/getNextRootDir.js'
import { runInit } from './runInit.js'
import { safelyRunScriptFunction } from './safelyRunScript.js'
import { createTestHooks } from './testHooks.js'
const prod = process.argv.includes('--prod')
@@ -43,7 +44,7 @@ await beforeTest()
const { rootDir, adminRoute } = getNextRootDir(testSuiteArg)
await runInit(testSuiteArg, true)
await safelyRunScriptFunction(runInit, 4000, testSuiteArg)
// Open the admin if the -o flag is passed
if (args.o) {