Skip to content

Commit

Permalink
Shifting the join command to allow spec passing
Browse files Browse the repository at this point in the history
  • Loading branch information
cahirodoherty-learningpool committed Sep 9, 2024
1 parent 3cbf056 commit ef4440b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,16 @@ async function populateTestFiles() {
const config = JSON.parse(fs.readFileSync('./build/course/config.json'));
const plugins = config?.build?.includes || [];

argumentValues.testfiles = plugins.map(plugin => {
const testFiles = plugins.map(plugin => {
return `**/${plugin}/**/*.cy.js`;
});

argumentValues.testfiles = testFiles.join(',');
}

async function cypressRun() {
await populateTestFiles();
return asyncSpawn('node', './node_modules/cypress/bin/cypress', 'run', '--spec', `${argumentValues.testfiles.join(',')}`, '--config', `{"fixturesFolder": "${argumentValues.outputdir}"}`);
return asyncSpawn('node', './node_modules/cypress/bin/cypress', 'run', '--spec', `${argumentValues.testfiles}`, '--config', `{"fixturesFolder": "${argumentValues.outputdir}"}`);
};

async function jestRun() {
Expand Down

0 comments on commit ef4440b

Please sign in to comment.