chore: gitignore test/databaseAdapter (#8235)

This commit is contained in:
Dan Ribbens
2024-09-16 13:02:08 -04:00
committed by GitHub
parent d046e0d18f
commit f72fd8543b
7 changed files with 61 additions and 107 deletions

View File

@@ -11,12 +11,20 @@ import type { SanitizedConfig } from 'payload'
import { fileURLToPath } from 'url'
import { generateDatabaseAdapter } from './generateDatabaseAdapter.js'
const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename)
let testDir: string
const writeDBAdapter = process.env.WRITE_DB_ADAPTER !== 'false'
async function run() {
if (writeDBAdapter) {
generateDatabaseAdapter(process.env.PAYLOAD_DATABASE || 'mongodb')
process.env.WRITE_DB_ADAPTER = 'false'
}
if (testConfigDir) {
testDir = path.resolve(dirname, testConfigDir)
@@ -45,6 +53,7 @@ async function run() {
for (const suiteDir of foundDirs) {
i++
const pathWithConfig = path.resolve(suiteDir, 'config.ts')
console.log(`Generating types for config ${i} / ${foundDirs.length}:`, pathWithConfig)
// start a new node process which runs test/generateTypes with pathWithConfig as argument. Can't run it in this process, as there could otherwise be