fix(testing): calculate correct support file path in cypress e2e preset (#22096)
This commit is contained in:
parent
511eb36fa7
commit
2bcde03c01
@ -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');
|
||||
|
||||
@ -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`,
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user