Skip to content

Commit

Permalink
fix(testing): calculate correct support file path in cypress e2e pres…
Browse files Browse the repository at this point in the history
…et (#22096)
  • Loading branch information
leosvelperez authored and jaysoo committed Mar 4, 2024
1 parent e11ac9d commit 3750141
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('React Module Federation', () => {
${false}
${true}
`(
'should generate host and remote apps',
'should generate host and remote apps with "--js=$js"',
async ({ js }) => {
const shell = uniq('shell');
const remote1 = uniq('remote1');
Expand Down
12 changes: 1 addition & 11 deletions packages/cypress/plugins/cypress-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,22 +102,12 @@ export function nxE2EPreset(
) {
const basePath = options?.cypressDir || 'src';

const dir = dirname(pathToConfig);
let supportFile: undefined | string = undefined;
for (const f of ['e2e.ts', 'e2e.js']) {
const candidate = join(dir, basePath, 'support', f);
if (existsSync(candidate)) {
supportFile = candidate;
break;
}
}

const baseConfig: any /*Cypress.EndToEndConfigOptions & {
[NX_PLUGIN_OPTIONS]: unknown;
}*/ = {
...nxBaseCypressPreset(pathToConfig),
fileServerFolder: '.',
supportFile,
supportFile: `${basePath}/support/e2e.{js,ts}`,
specPattern: `${basePath}/**/*.cy.{js,jsx,ts,tsx}`,
fixturesFolder: `${basePath}/fixtures`,

Expand Down

0 comments on commit 3750141

Please sign in to comment.