Merge pull request #17473 from strapi/chore/test-setup

This commit is contained in:
Alexandre BODIN 2023-07-27 16:40:39 +02:00 committed by GitHub
commit 27098aad74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -25,7 +25,7 @@ const cleanTestApp = (appPath) => {
* @param {string} options.appPath - Name of the app that will be created (also the name of the folder) * @param {string} options.appPath - Name of the app that will be created (also the name of the folder)
* @param {database} options.database - Arguments to create the testApp with the provided database params * @param {database} options.database - Arguments to create the testApp with the provided database params
*/ */
const generateTestApp = async ({ appPath, database, template }) => { const generateTestApp = async ({ appPath, database, template, link = false }) => {
const scope = { const scope = {
database, database,
rootPath: path.resolve(appPath), rootPath: path.resolve(appPath),
@ -54,7 +54,9 @@ const generateTestApp = async ({ appPath, database, template }) => {
}; };
await generateNew(scope); await generateNew(scope);
await linkPackages(appPath); if (link) {
await linkPackages(appPath);
}
}; };
const linkPackages = async (appPath) => { const linkPackages = async (appPath) => {

View File

@ -107,6 +107,7 @@ yargs
useNullAsDefault: true, useNullAsDefault: true,
}, },
template: path.join(cwd, 'e2e', 'app-template'), template: path.join(cwd, 'e2e', 'app-template'),
link: true,
}); });
/** /**
* Because we're running multiple test apps at the same time * Because we're running multiple test apps at the same time