chore: rework test hooks to reset tsconfig.json

This commit is contained in:
Elliot DeNolf
2024-03-16 06:30:16 -04:00
parent b215eae914
commit e739c26f2e
7 changed files with 99 additions and 72 deletions

View File

@@ -1,30 +0,0 @@
import minimist from 'minimist'
import { nextDev } from 'next/dist/cli/next-dev.js'
import { dirname, resolve } from 'path'
import { fileURLToPath } from 'url'
import { beforeTest } from './beforeTest.js'
const _filename = fileURLToPath(import.meta.url)
const _dirname = dirname(_filename)
main()
process.env.PAYLOAD_DROP_DATABASE = true
async function main() {
const {
_: [testSuiteArg],
...args
} = minimist(process.argv.slice(2))
if (args.turbo === true) {
process.env.TURBOPACK = '1'
}
process.env.PAYLOAD_DROP_DATABASE = 'true'
beforeTest(testSuiteArg)
nextDev({ _: [resolve(_dirname, '..')], port: process.env.PORT || 3000 })
}