fix(angular): support inferred cypress targets in setup-mf generator (#21619)
This commit is contained in:
parent
86ba07e2a8
commit
758c1ab70e
@ -371,21 +371,17 @@ describe('Angular Module Federation', () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Build host and remote
|
// Build host and remote
|
||||||
const buildOutput = await runCommandUntil(`build ${host}`, (output) =>
|
const buildHostOutput = runCLI(`build ${host}`);
|
||||||
output.includes('Successfully ran target build')
|
expect(buildHostOutput).toContain('Successfully ran target build');
|
||||||
);
|
const buildRemoteOutput = runCLI(`build ${remote}`);
|
||||||
await killProcessAndPorts(buildOutput.pid);
|
expect(buildRemoteOutput).toContain('Successfully ran target build');
|
||||||
const remoteOutput = await runCommandUntil(`build ${remote}`, (output) =>
|
|
||||||
output.includes('Successfully ran target build')
|
|
||||||
);
|
|
||||||
await killProcessAndPorts(remoteOutput.pid);
|
|
||||||
|
|
||||||
if (runE2ETests()) {
|
if (runE2ETests()) {
|
||||||
const hostE2eResults = await runCommandUntil(
|
const e2eProcess = await runCommandUntil(
|
||||||
`e2e ${host}-e2e --no-watch --verbose`,
|
`e2e ${host}-e2e --no-watch --verbose`,
|
||||||
(output) => output.includes('All specs passed!')
|
(output) => output.includes('All specs passed!')
|
||||||
);
|
);
|
||||||
await killProcessAndPorts(hostE2eResults.pid, hostPort, hostPort + 1);
|
await killProcessAndPorts(e2eProcess.pid, hostPort, hostPort + 1);
|
||||||
}
|
}
|
||||||
}, 500_000);
|
}, 500_000);
|
||||||
|
|
||||||
@ -467,21 +463,17 @@ describe('Angular Module Federation', () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Build host and remote
|
// Build host and remote
|
||||||
const buildOutput = await runCommandUntil(`build ${host}`, (output) =>
|
const buildHostOutput = runCLI(`build ${host}`);
|
||||||
output.includes('Successfully ran target build')
|
expect(buildHostOutput).toContain('Successfully ran target build');
|
||||||
);
|
const buildRemoteOutput = runCLI(`build ${remote}`);
|
||||||
await killProcessAndPorts(buildOutput.pid);
|
expect(buildRemoteOutput).toContain('Successfully ran target build');
|
||||||
const remoteOutput = await runCommandUntil(`build ${remote}`, (output) =>
|
|
||||||
output.includes('Successfully ran target build')
|
|
||||||
);
|
|
||||||
await killProcessAndPorts(remoteOutput.pid);
|
|
||||||
|
|
||||||
if (runE2ETests()) {
|
if (runE2ETests()) {
|
||||||
const hostE2eResults = await runCommandUntil(
|
const e2eProcess = await runCommandUntil(
|
||||||
`e2e ${host}-e2e --no-watch --verbose`,
|
`e2e ${host}-e2e --no-watch --verbose`,
|
||||||
(output) => output.includes('All specs passed!')
|
(output) => output.includes('All specs passed!')
|
||||||
);
|
);
|
||||||
await killProcessAndPorts(hostE2eResults.pid, hostPort, hostPort + 1);
|
await killProcessAndPorts(e2eProcess.pid, hostPort, hostPort + 1);
|
||||||
}
|
}
|
||||||
}, 500_000);
|
}, 500_000);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -2,8 +2,10 @@
|
|||||||
// as Angular attempt to figure out how to fix HMR when styles.js
|
// as Angular attempt to figure out how to fix HMR when styles.js
|
||||||
// is attached to the index.html with type=module
|
// is attached to the index.html with type=module
|
||||||
|
|
||||||
|
import { CYPRESS_CONFIG_FILE_NAME_PATTERN } from '@nx/cypress/src/utils/config';
|
||||||
import type { ProjectConfiguration, Tree } from '@nx/devkit';
|
import type { ProjectConfiguration, Tree } from '@nx/devkit';
|
||||||
import {
|
import {
|
||||||
|
glob,
|
||||||
joinPathFragments,
|
joinPathFragments,
|
||||||
logger,
|
logger,
|
||||||
readProjectConfiguration,
|
readProjectConfiguration,
|
||||||
@ -31,8 +33,9 @@ export function addCypressOnErrorWorkaround(tree: Tree, schema: Schema) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
e2eProject.targets.e2e.executor !== '@nx/cypress:cypress' &&
|
e2eProject.targets?.e2e?.executor !== '@nx/cypress:cypress' &&
|
||||||
e2eProject.targets.e2e.executor !== '@nx/cypress:cypress'
|
!glob(tree, [`${e2eProject.root}/${CYPRESS_CONFIG_FILE_NAME_PATTERN}`])
|
||||||
|
.length
|
||||||
) {
|
) {
|
||||||
// Not a cypress e2e project, skip
|
// Not a cypress e2e project, skip
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user