Skip to content

Commit

Permalink
chore: Set default support file for Cypress 12.x or superior
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfp13 committed Oct 27, 2023
1 parent d9418fb commit 84e74d4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/cli/src/utils/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
symlinkSync,
writeFileSync,
writeJsonSync,
moveSync,
} from 'fs-extra'

import path from 'path'
Expand Down Expand Up @@ -93,6 +94,14 @@ async function copyCypressFiles() {
copySync(`${userDir}/cypress`, `${tmpDir}/cypress/e2e`, {
overwrite: true,
})

// Set default Cypress 12.x (or superior) support file
if (userStoreConfig?.experimental?.cypressVersion > 9) {
if (existsSync(`${tmpDir}/cypress/support/index.js`)) {
moveSync(`${tmpDir}/cypress/support/index.js`, `${tmpDir}/cypress/support/e2e.ts`)
}
}

console.log(`${chalk.green('success')} - Cypress test files copied`)
}
} catch (e) {
Expand Down

0 comments on commit 84e74d4

Please sign in to comment.