cleanup(testing): ensure cypress installed for comp tests (#15147)

This commit is contained in:
Colum Ferry 2023-02-21 17:33:50 +00:00 committed by GitHub
parent 61e28c63c3
commit 19bfd8ef6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@ import {
createFile, createFile,
newProject, newProject,
runCLI, runCLI,
runCypressTests,
uniq, uniq,
updateFile, updateFile,
updateProjectConfig, updateProjectConfig,
@ -174,18 +175,22 @@ import {CommonModule} from '@angular/common';
runCLI( runCLI(
`generate @nrwl/angular:cypress-component-configuration --project=${appName} --generate-tests --no-interactive` `generate @nrwl/angular:cypress-component-configuration --project=${appName} --generate-tests --no-interactive`
); );
expect(runCLI(`component-test ${appName} --no-watch`)).toContain( if (runCypressTests()) {
'All specs passed!' expect(runCLI(`component-test ${appName} --no-watch`)).toContain(
); 'All specs passed!'
);
}
}, 300_000); }, 300_000);
it('should successfully component test lib being used in app', () => { it('should successfully component test lib being used in app', () => {
runCLI( runCLI(
`generate @nrwl/angular:cypress-component-configuration --project=${usedInAppLibName} --generate-tests --no-interactive` `generate @nrwl/angular:cypress-component-configuration --project=${usedInAppLibName} --generate-tests --no-interactive`
); );
expect(runCLI(`component-test ${usedInAppLibName} --no-watch`)).toContain( if (runCypressTests()) {
'All specs passed!' expect(runCLI(`component-test ${usedInAppLibName} --no-watch`)).toContain(
); 'All specs passed!'
);
}
}, 300_000); }, 300_000);
it('should test buildable lib not being used in app', () => { it('should test buildable lib not being used in app', () => {
@ -260,9 +265,11 @@ describe(InputStandaloneComponent.name, () => {
runCLI( runCLI(
`generate @nrwl/angular:cypress-component-configuration --project=${buildableLibName} --generate-tests --build-target=${appName}:build --no-interactive` `generate @nrwl/angular:cypress-component-configuration --project=${buildableLibName} --generate-tests --build-target=${appName}:build --no-interactive`
); );
expect(runCLI(`component-test ${buildableLibName} --no-watch`)).toContain( if (runCypressTests()) {
'All specs passed!' expect(runCLI(`component-test ${buildableLibName} --no-watch`)).toContain(
); 'All specs passed!'
);
}
// add tailwind // add tailwind
runCLI( runCLI(