Files
payload/test/helpers/setTestEnvPaths.ts
Dan Ribbens eba53ba60a feat: forceAcceptWarning migration arg added to accept prompts (#4874)
* chore: gitignore test migrations

* feat: `forceAcceptWarning` migration args added to accept prompts

* chore: migrationDir env variable fallback

* chore: migrationDir testSuiteDir fallback

* chore: migrationDir testSuiteDir fallback fix

* chore: skip migrate down test
2024-01-26 13:48:53 -05:00

15 lines
421 B
TypeScript

// Set config path and TS output path using test dir
import fs from 'fs'
import path from 'path'
export function setTestEnvPaths(dir) {
const configPath = path.resolve(dir, 'config.ts')
const outputPath = path.resolve(dir, 'payload-types.ts')
if (fs.existsSync(configPath)) {
process.env.PAYLOAD_CONFIG_PATH = configPath
process.env.PAYLOAD_TS_OUTPUT_PATH = outputPath
return true
}
return false
}