diff --git a/e2e/angular-extensions/src/cypress-component-tests.test.ts b/e2e/angular-extensions/src/cypress-component-tests.test.ts index 5f37646d75..22ad10262c 100644 --- a/e2e/angular-extensions/src/cypress-component-tests.test.ts +++ b/e2e/angular-extensions/src/cypress-component-tests.test.ts @@ -1,5 +1,6 @@ import { checkFilesDoNotExist, + cleanupProject, createFile, newProject, runCLI, @@ -144,6 +145,8 @@ import {CommonModule} from '@angular/common'; }); }); + afterAll(() => cleanupProject()); + it('should test app', () => { runCLI( `generate @nrwl/angular:cypress-component-configuration --project=${appName} --generate-tests --no-interactive` diff --git a/e2e/cypress/src/cypress.test.ts b/e2e/cypress/src/cypress.test.ts index 62fffefdb7..61feae4b9d 100644 --- a/e2e/cypress/src/cypress.test.ts +++ b/e2e/cypress/src/cypress.test.ts @@ -1,5 +1,6 @@ import { checkFilesExist, + cleanupProject, createFile, killPorts, newProject, @@ -12,9 +13,13 @@ import { describe('Cypress E2E Test runner', () => { const myapp = uniq('myapp'); + beforeAll(() => { newProject(); }); + + afterAll(() => cleanupProject()); + it('should generate an app with the Cypress as e2e test runner', () => { runCLI( `generate @nrwl/react:app ${myapp} --e2eTestRunner=cypress --linter=eslint` diff --git a/e2e/jest/src/jest.test.ts b/e2e/jest/src/jest.test.ts index ab71f72864..e9bbd87fdd 100644 --- a/e2e/jest/src/jest.test.ts +++ b/e2e/jest/src/jest.test.ts @@ -6,6 +6,7 @@ import { uniq, updateFile, expectJestTestsToPass, + cleanupProject, } from '@nrwl/e2e/utils'; describe('Jest', () => { @@ -13,6 +14,8 @@ describe('Jest', () => { newProject({ name: uniq('proj-jest') }); }); + afterAll(() => cleanupProject()); + it('should be able test projects using jest', async () => { await expectJestTestsToPass('@nrwl/workspace:lib'); await expectJestTestsToPass('@nrwl/js:lib'); @@ -50,10 +53,10 @@ describe('Jest', () => { stripIndents` const { registerTsProject } = require('nx/src/utils/register'); const cleanup = registerTsProject('.', 'tsconfig.base.json'); - - import {setup} from '@global-fun/globals'; + + import {setup} from '@global-fun/globals'; export default async function() {setup();} - + cleanup(); ` ); @@ -63,8 +66,8 @@ describe('Jest', () => { stripIndents` import { registerTsProject } from 'nx/src/utils/register'; const cleanup = registerTsProject('.', 'tsconfig.base.json'); - - import {teardown} from '@global-fun/globals'; + + import {teardown} from '@global-fun/globals'; export default async function() {teardown();} cleanup(); ` diff --git a/e2e/react/src/cypress-component-tests.test.ts b/e2e/react/src/cypress-component-tests.test.ts index e397a3f51b..48b2471585 100644 --- a/e2e/react/src/cypress-component-tests.test.ts +++ b/e2e/react/src/cypress-component-tests.test.ts @@ -1,4 +1,5 @@ import { + cleanupProject, createFile, newProject, runCLI, @@ -12,6 +13,7 @@ describe('React Cypress Component Tests', () => { const appName = uniq('cy-react-app'); const usedInAppLibName = uniq('cy-react-lib'); const buildableLibName = uniq('cy-react-buildable-lib'); + beforeAll(() => { projectName = newProject({ name: uniq('cy-react') }); runCLI(`generate @nrwl/react:app ${appName} --no-interactive`); @@ -96,8 +98,8 @@ export interface InputProps { } export function Input(props: InputProps) { - return ( -