test: missing test dir deps, update cpa create project suite
This commit is contained in:
@@ -77,23 +77,31 @@ describe('createProject', () => {
|
||||
expect(packageJson.name).toEqual(projectName)
|
||||
})
|
||||
|
||||
describe('db adapters and bundlers', () => {
|
||||
describe('db adapters', () => {
|
||||
const templates = getValidTemplates()
|
||||
|
||||
it.each([
|
||||
['blank', 'mongodb', 'webpack'],
|
||||
['blank', 'postgres', 'webpack'],
|
||||
['website', 'mongodb', 'webpack'],
|
||||
['website', 'postgres', 'webpack'],
|
||||
['ecommerce', 'mongodb', 'webpack'],
|
||||
['ecommerce', 'postgres', 'webpack'],
|
||||
])('update config and deps: %s, %s, %s', async (templateName, db, bundler) => {
|
||||
['blank-3.0', 'mongodb'],
|
||||
['blank-3.0', 'postgres'],
|
||||
|
||||
// TODO: Re-enable these once 3.0 is stable and templates updated
|
||||
// ['website', 'mongodb'],
|
||||
// ['website', 'postgres'],
|
||||
// ['ecommerce', 'mongodb'],
|
||||
// ['ecommerce', 'postgres'],
|
||||
])('update config and deps: %s, %s', async (templateName, db) => {
|
||||
const projectName = 'starter-project'
|
||||
|
||||
const template = templates.find((t) => t.name === templateName)
|
||||
|
||||
const cliArgs = {
|
||||
...args,
|
||||
'--db': db,
|
||||
'--local-template': templateName,
|
||||
} as CliArgs
|
||||
|
||||
await createProject({
|
||||
cliArgs: args,
|
||||
cliArgs,
|
||||
projectName,
|
||||
projectDir,
|
||||
template: template as ProjectTemplate,
|
||||
@@ -114,7 +122,7 @@ describe('createProject', () => {
|
||||
Object.keys(packageJson.dependencies).filter((n) => n.startsWith('@payloadcms/db-')),
|
||||
).toHaveLength(1)
|
||||
|
||||
let payloadConfigPath = path.resolve(projectDir, 'src/payload.config.ts')
|
||||
let payloadConfigPath = path.resolve(projectDir, 'payload.config.ts')
|
||||
|
||||
// Website and ecommerce templates have payload.config.ts in src/payload
|
||||
if (!fse.existsSync(payloadConfigPath)) {
|
||||
|
||||
@@ -8,5 +8,5 @@
|
||||
"rootDir": "./src" /* Specify the root folder within your source files. */
|
||||
},
|
||||
"exclude": ["dist", "build", "tests", "test", "node_modules", ".eslintrc.js"],
|
||||
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"]
|
||||
"include": ["src/**/*.ts", "src/**/*.spec.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"]
|
||||
}
|
||||
|
||||
12
pnpm-lock.yaml
generated
12
pnpm-lock.yaml
generated
@@ -1562,6 +1562,9 @@ importers:
|
||||
'@payloadcms/ui':
|
||||
specifier: workspace:*
|
||||
version: link:../packages/ui
|
||||
comment-json:
|
||||
specifier: ^4.2.3
|
||||
version: 4.2.3
|
||||
create-payload-app:
|
||||
specifier: workspace:*
|
||||
version: link:../packages/create-payload-app
|
||||
@@ -1571,9 +1574,18 @@ importers:
|
||||
eslint-plugin-playwright:
|
||||
specifier: 1.5.3
|
||||
version: 1.5.3(eslint@8.57.0)
|
||||
execa:
|
||||
specifier: 5.1.1
|
||||
version: 5.1.1
|
||||
payload:
|
||||
specifier: workspace:*
|
||||
version: link:../packages/payload
|
||||
tempy:
|
||||
specifier: ^1.0.1
|
||||
version: 1.0.1
|
||||
typescript:
|
||||
specifier: 5.4.2
|
||||
version: 5.4.2
|
||||
|
||||
packages:
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ describe('create-payload-app', () => {
|
||||
'--debug': true,
|
||||
projectDir,
|
||||
useDistFiles: true, // create-payload-app/dist/app/(payload)
|
||||
packageManager: 'pnpm',
|
||||
})
|
||||
|
||||
expect(result.success).toBe(true)
|
||||
|
||||
@@ -35,6 +35,10 @@
|
||||
"create-payload-app": "workspace:*",
|
||||
"eslint-plugin-playwright": "1.5.3",
|
||||
"eslint-plugin-payload": "workspace:*",
|
||||
"payload": "workspace:*"
|
||||
"payload": "workspace:*",
|
||||
"execa": "5.1.1",
|
||||
"tempy": "^1.0.1",
|
||||
"comment-json": "^4.2.3",
|
||||
"typescript": "5.4.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ export const createTestHooks = async (testSuiteName = '_community') => {
|
||||
|
||||
await writeFile(tsConfigPath, JSON.stringify(tsConfig, null, 2) + '\n')
|
||||
|
||||
execSync(`prettier --write ${tsConfigPath}`, { cwd: path.resolve(dirname, '../') })
|
||||
execSync(`pnpm prettier --write ${tsConfigPath}`, { cwd: path.resolve(dirname, '../') })
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user