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

@@ -1,7 +1,4 @@
import fs from 'fs'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import { getDatabaseAdapter } from './getDatabaseAdapter.js'
import { generateDatabaseAdapter } from './generateDatabaseAdapter.js'
process.env.PAYLOAD_DISABLE_ADMIN = 'true'
process.env.PAYLOAD_DROP_DATABASE = 'true'
@@ -11,22 +8,6 @@ process.env.PAYLOAD_PUBLIC_CLOUD_STORAGE_ADAPTER = 's3'
process.env.NODE_OPTIONS = '--no-deprecation'
process.env.PAYLOAD_CI_DEPENDENCY_CHECKER = 'true'
const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename)
const dbAdapter = process.env.PAYLOAD_DATABASE || 'mongodb'
// Generate databaseAdapter.ts
const databaseAdapter = getDatabaseAdapter(dbAdapter)
// Write to databaseAdapter.ts
fs.writeFileSync(
path.resolve(dirname, 'databaseAdapter.ts'),
`
// DO NOT MODIFY. This file is automatically generated in initDevAndTest.ts
${databaseAdapter}
`,
)
console.log('Wrote', dbAdapter, 'db adapter')
generateDatabaseAdapter(dbAdapter)