chore: working pattern for debugging e2e and int
This commit is contained in:
@@ -8,6 +8,7 @@ import type { GeneratedTypes } from './sdk/types.js'
|
||||
|
||||
import { createTestHooks } from '../testHooks.js'
|
||||
import { PayloadTestSDK } from './sdk/index.js'
|
||||
import startMemoryDB from './startMemoryDB.js'
|
||||
|
||||
type Args = {
|
||||
dirname: string
|
||||
@@ -29,6 +30,8 @@ export async function initPayloadE2ENoConfig<T extends GeneratedTypes<T>>({
|
||||
process.env.PORT = String(port)
|
||||
const serverURL = `http://localhost:${port}`
|
||||
|
||||
await startMemoryDB()
|
||||
|
||||
// @ts-expect-error
|
||||
const app = nextImport({
|
||||
dev: true,
|
||||
|
||||
@@ -16,7 +16,7 @@ const customJestConfig = {
|
||||
},
|
||||
reporters: ['default', ['github-actions', { silent: false }], 'summary'],
|
||||
testEnvironment: 'node',
|
||||
globalSetup: path.resolve(dirname, 'setup.ts'),
|
||||
globalSetup: path.resolve(dirname, './helpers/startMemoryDB.ts'),
|
||||
testMatch: ['<rootDir>/**/*int.spec.ts'],
|
||||
testTimeout: 90000,
|
||||
transform: {
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
import { defineConfig } from '@playwright/test'
|
||||
import path from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
const filename = fileURLToPath(import.meta.url)
|
||||
const dirname = path.dirname(filename)
|
||||
|
||||
export const EXPECT_TIMEOUT = 45000
|
||||
export const POLL_TOPASS_TIMEOUT = EXPECT_TIMEOUT * 4 // That way expect.poll() or expect().toPass can retry 4 times. 4x higher than default expect timeout => can retry 4 times if retryable expects are used inside
|
||||
@@ -18,7 +13,6 @@ export default defineConfig({
|
||||
trace: 'retain-on-failure',
|
||||
video: 'retain-on-failure',
|
||||
},
|
||||
globalSetup: path.resolve(dirname, 'setup.js'),
|
||||
expect: {
|
||||
timeout: EXPECT_TIMEOUT,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user