I noticed a few issues when running e2e tests that will be resolved by this PR: - Most important: for some test suites (fields, fields-relationship, versions, queues, lexical), the database was cleared and seeded **twice** in between each test run. This is because the onInit function was running the clear and seed script, when it should only have been running the seed script. Clearing the database / the snapshot workflow is being done by the reInit endpoint, which then calls onInit to seed the actual data. - The slowest part of `clearAndSeedEverything` is recreating indexes on mongodb. This PR slightly improves performance here by: - Skipping this process for the built-in `['payload-migrations', 'payload-preferences', 'payload-locked-documents']` collections - Previously we were calling both `createIndexes` and `ensureIndexes`. This was unnecessary - `ensureIndexes` is a deprecated alias of `createIndexes`. This PR changes it to only call `createIndexes` - Makes the reinit endpoint accept GET requests instead of POST requests - this makes it easier to debug right in the browser - Some typescript fixes - Adds a `dev:memorydb` script to the package.json. For some reason, `dev` is super unreliable on mongodb locally when running e2e tests - it frequently fails during index creation. Using the memorydb fixes this issue, with the bonus of more closely resembling the CI environment - Previously, you were unable to run test suites using turbopack + postgres. This fixes it, by explicitly installing `pg` as devDependency in our monorepo - Fixes jest open handles warning
100 lines
3.5 KiB
JSON
100 lines
3.5 KiB
JSON
{
|
|
"name": "payload-test-suite",
|
|
"version": "0.0.1",
|
|
"private": true,
|
|
"description": "Payload test suite",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "cross-env NODE_OPTIONS=--no-deprecation node ./dev.js",
|
|
"test": "pnpm -C \"../\" run test",
|
|
"test:e2e": "pnpm -C \"../\" run test:e2e",
|
|
"test:int": "pnpm -C \"../\" run test:int",
|
|
"typecheck": "pnpm turbo build --filter payload-test-suite && tsc --project tsconfig.typecheck.json"
|
|
},
|
|
"lint-staged": {
|
|
"**/package.json": "sort-package-json",
|
|
"*.{md,mdx,yml,json}": "prettier --write",
|
|
"*.{js,jsx,ts,tsx}": [
|
|
"prettier --write",
|
|
"eslint --cache --fix"
|
|
],
|
|
"templates/website/**/*": "sh -c \"cd templates/website; pnpm install --ignore-workspace --frozen-lockfile; pnpm run lint --fix\"",
|
|
"tsconfig.json": "node scripts/reset-tsconfig.js"
|
|
},
|
|
"devDependencies": {
|
|
"@aws-sdk/client-s3": "^3.614.0",
|
|
"@date-fns/tz": "1.2.0",
|
|
"@next/env": "15.3.2",
|
|
"@payloadcms/admin-bar": "workspace:*",
|
|
"@payloadcms/db-mongodb": "workspace:*",
|
|
"@payloadcms/db-postgres": "workspace:*",
|
|
"@payloadcms/db-sqlite": "workspace:*",
|
|
"@payloadcms/db-vercel-postgres": "workspace:*",
|
|
"@payloadcms/drizzle": "workspace:*",
|
|
"@payloadcms/email-nodemailer": "workspace:*",
|
|
"@payloadcms/email-resend": "workspace:*",
|
|
"@payloadcms/eslint-config": "workspace:*",
|
|
"@payloadcms/eslint-plugin": "workspace:*",
|
|
"@payloadcms/graphql": "workspace:*",
|
|
"@payloadcms/live-preview": "workspace:*",
|
|
"@payloadcms/live-preview-react": "workspace:*",
|
|
"@payloadcms/next": "workspace:*",
|
|
"@payloadcms/payload-cloud": "workspace:*",
|
|
"@payloadcms/plugin-cloud-storage": "workspace:*",
|
|
"@payloadcms/plugin-form-builder": "workspace:*",
|
|
"@payloadcms/plugin-import-export": "workspace:*",
|
|
"@payloadcms/plugin-multi-tenant": "workspace:*",
|
|
"@payloadcms/plugin-nested-docs": "workspace:*",
|
|
"@payloadcms/plugin-redirects": "workspace:*",
|
|
"@payloadcms/plugin-search": "workspace:*",
|
|
"@payloadcms/plugin-sentry": "workspace:*",
|
|
"@payloadcms/plugin-seo": "workspace:*",
|
|
"@payloadcms/plugin-stripe": "workspace:*",
|
|
"@payloadcms/richtext-lexical": "workspace:*",
|
|
"@payloadcms/richtext-slate": "workspace:*",
|
|
"@payloadcms/storage-azure": "workspace:*",
|
|
"@payloadcms/storage-gcs": "workspace:*",
|
|
"@payloadcms/storage-s3": "workspace:*",
|
|
"@payloadcms/storage-uploadthing": "workspace:*",
|
|
"@payloadcms/storage-vercel-blob": "workspace:*",
|
|
"@payloadcms/translations": "workspace:*",
|
|
"@payloadcms/ui": "workspace:*",
|
|
"@sentry/nextjs": "^8.33.1",
|
|
"@sentry/react": "^7.77.0",
|
|
"@types/jest": "29.5.12",
|
|
"@types/react": "19.1.0",
|
|
"@types/react-dom": "19.1.2",
|
|
"babel-plugin-react-compiler": "19.1.0-rc.2",
|
|
"comment-json": "^4.2.3",
|
|
"create-payload-app": "workspace:*",
|
|
"csv-parse": "^5.6.0",
|
|
"dequal": "2.0.3",
|
|
"dotenv": "16.4.7",
|
|
"drizzle-kit": "0.28.0",
|
|
"drizzle-orm": "0.36.1",
|
|
"escape-html": "1.0.3",
|
|
"eslint-plugin-playwright": "2.2.0",
|
|
"execa": "5.1.1",
|
|
"file-type": "19.3.0",
|
|
"http-status": "2.1.0",
|
|
"jest": "29.7.0",
|
|
"jwt-decode": "4.0.0",
|
|
"mongoose": "8.9.5",
|
|
"next": "15.3.2",
|
|
"nodemailer": "6.9.16",
|
|
"payload": "workspace:*",
|
|
"pg": "8.11.3",
|
|
"qs-esm": "7.0.2",
|
|
"react": "19.1.0",
|
|
"react-dom": "19.1.0",
|
|
"sass": "1.77.4",
|
|
"server-only": "^0.0.1",
|
|
"sharp": "0.32.6",
|
|
"slate": "0.91.4",
|
|
"tempy": "^1.0.1",
|
|
"ts-essentials": "10.0.3",
|
|
"typescript": "5.7.3",
|
|
"uuid": "10.0.0"
|
|
}
|
|
}
|