* 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
15 lines
421 B
TypeScript
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
|
|
}
|