fix(testing): add cleanup on cypress e2e tests (#12089)
This commit is contained in:
parent
f84f2819f6
commit
96be1f55fe
@ -1,5 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
checkFilesDoNotExist,
|
checkFilesDoNotExist,
|
||||||
|
cleanupProject,
|
||||||
createFile,
|
createFile,
|
||||||
newProject,
|
newProject,
|
||||||
runCLI,
|
runCLI,
|
||||||
@ -144,6 +145,8 @@ import {CommonModule} from '@angular/common';
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
afterAll(() => cleanupProject());
|
||||||
|
|
||||||
it('should test app', () => {
|
it('should test app', () => {
|
||||||
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`
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
checkFilesExist,
|
checkFilesExist,
|
||||||
|
cleanupProject,
|
||||||
createFile,
|
createFile,
|
||||||
killPorts,
|
killPorts,
|
||||||
newProject,
|
newProject,
|
||||||
@ -12,9 +13,13 @@ import {
|
|||||||
|
|
||||||
describe('Cypress E2E Test runner', () => {
|
describe('Cypress E2E Test runner', () => {
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
newProject();
|
newProject();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
afterAll(() => cleanupProject());
|
||||||
|
|
||||||
it('should generate an app with the Cypress as e2e test runner', () => {
|
it('should generate an app with the Cypress as e2e test runner', () => {
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:app ${myapp} --e2eTestRunner=cypress --linter=eslint`
|
`generate @nrwl/react:app ${myapp} --e2eTestRunner=cypress --linter=eslint`
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import {
|
|||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
expectJestTestsToPass,
|
expectJestTestsToPass,
|
||||||
|
cleanupProject,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nrwl/e2e/utils';
|
||||||
|
|
||||||
describe('Jest', () => {
|
describe('Jest', () => {
|
||||||
@ -13,6 +14,8 @@ describe('Jest', () => {
|
|||||||
newProject({ name: uniq('proj-jest') });
|
newProject({ name: uniq('proj-jest') });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
afterAll(() => cleanupProject());
|
||||||
|
|
||||||
it('should be able test projects using jest', async () => {
|
it('should be able test projects using jest', async () => {
|
||||||
await expectJestTestsToPass('@nrwl/workspace:lib');
|
await expectJestTestsToPass('@nrwl/workspace:lib');
|
||||||
await expectJestTestsToPass('@nrwl/js:lib');
|
await expectJestTestsToPass('@nrwl/js:lib');
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
|
cleanupProject,
|
||||||
createFile,
|
createFile,
|
||||||
newProject,
|
newProject,
|
||||||
runCLI,
|
runCLI,
|
||||||
@ -12,6 +13,7 @@ describe('React Cypress Component Tests', () => {
|
|||||||
const appName = uniq('cy-react-app');
|
const appName = uniq('cy-react-app');
|
||||||
const usedInAppLibName = uniq('cy-react-lib');
|
const usedInAppLibName = uniq('cy-react-lib');
|
||||||
const buildableLibName = uniq('cy-react-buildable-lib');
|
const buildableLibName = uniq('cy-react-buildable-lib');
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
projectName = newProject({ name: uniq('cy-react') });
|
projectName = newProject({ name: uniq('cy-react') });
|
||||||
runCLI(`generate @nrwl/react:app ${appName} --no-interactive`);
|
runCLI(`generate @nrwl/react:app ${appName} --no-interactive`);
|
||||||
@ -117,6 +119,8 @@ export default Input;
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
afterAll(() => cleanupProject());
|
||||||
|
|
||||||
it('should test app', () => {
|
it('should test app', () => {
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:cypress-component-configuration --project=${appName} --generate-tests`
|
`generate @nrwl/react:cypress-component-configuration --project=${appName} --generate-tests`
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user