test: update e2e suites
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import getPort from 'get-port'
|
||||
import path from 'path'
|
||||
import shelljs from 'shelljs'
|
||||
|
||||
import type { Payload } from '../../packages/payload/src'
|
||||
import type { SanitizedConfig } from '../../packages/payload/src/config/types'
|
||||
@@ -10,12 +9,14 @@ import { bootAdminPanel } from './bootAdminPanel'
|
||||
|
||||
type InitializedPayload = { payload: Payload; serverURL: string }
|
||||
|
||||
export async function initPayloadE2E(
|
||||
config: Promise<SanitizedConfig>,
|
||||
): Promise<InitializedPayload> {
|
||||
const webpackCachePath = path.resolve(__dirname, '../../node_modules/.cache/webpack')
|
||||
shelljs.rm('-rf', webpackCachePath)
|
||||
export async function initPayloadE2E(args: {
|
||||
config: Promise<SanitizedConfig>
|
||||
dirname: string
|
||||
}): Promise<InitializedPayload> {
|
||||
const { config, dirname } = args
|
||||
|
||||
// process.env.TURBOPACK = '1' // Not working due to turbopack pulling in mongoose, pg
|
||||
process.env.PAYLOAD_CONFIG_PATH = path.resolve(dirname, './config.ts')
|
||||
process.env.PAYLOAD_DROP_DATABASE = 'true'
|
||||
process.env.NODE_ENV = 'test'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user