fix(core): add cleanup on e2e tests (#12093)
This commit is contained in:
parent
27d654a08d
commit
635b2a61a7
@ -1,4 +1,5 @@
|
||||
import {
|
||||
cleanupProject,
|
||||
createNonNxProjectDirectory,
|
||||
getPackageManagerCommand,
|
||||
getSelectedPackageManager,
|
||||
@ -13,6 +14,8 @@ describe('nx init', () => {
|
||||
packageManager: getSelectedPackageManager(),
|
||||
}).runUninstalledPackage;
|
||||
|
||||
afterEach(() => cleanupProject());
|
||||
|
||||
it('should work', () => {
|
||||
createNonNxProjectDirectory();
|
||||
updateFile(
|
||||
|
||||
@ -8,9 +8,8 @@ import {
|
||||
} from '@nrwl/e2e/utils';
|
||||
|
||||
describe('project graph creation', () => {
|
||||
let proj;
|
||||
|
||||
beforeEach(() => newProject());
|
||||
|
||||
afterEach(() => cleanupProject());
|
||||
|
||||
it('should correctly build the nxdeps.json containing files for the project', () => {
|
||||
|
||||
@ -19,6 +19,8 @@ describe('Nx Commands', () => {
|
||||
let proj: string;
|
||||
beforeAll(() => (proj = newProject()));
|
||||
|
||||
afterAll(() => cleanupProject());
|
||||
|
||||
describe('report and list', () => {
|
||||
it(`should report package versions`, async () => {
|
||||
const reportOutput = runCLI('report');
|
||||
@ -79,6 +81,7 @@ describe('Nx Commands', () => {
|
||||
);
|
||||
}, 120000);
|
||||
});
|
||||
|
||||
describe('format', () => {
|
||||
const myapp = uniq('myapp');
|
||||
const mylib = uniq('mylib');
|
||||
@ -88,8 +91,6 @@ describe('Nx Commands', () => {
|
||||
runCLI(`generate @nrwl/js:lib ${mylib}`);
|
||||
});
|
||||
|
||||
afterAll(() => cleanupProject());
|
||||
|
||||
beforeEach(() => {
|
||||
updateFile(
|
||||
`apps/${myapp}/src/main.ts`,
|
||||
|
||||
@ -14,7 +14,7 @@ import {
|
||||
describe('cache', () => {
|
||||
beforeEach(() => newProject());
|
||||
|
||||
afterAll(() => cleanupProject());
|
||||
afterEach(() => cleanupProject());
|
||||
|
||||
it('should cache command execution', async () => {
|
||||
const myapp1 = uniq('myapp1');
|
||||
|
||||
@ -5,11 +5,14 @@ import {
|
||||
runCLI,
|
||||
uniq,
|
||||
runCreatePlugin,
|
||||
cleanupProject,
|
||||
} from '@nrwl/e2e/utils';
|
||||
|
||||
describe('create-nx-plugin', () => {
|
||||
const packageManager = getSelectedPackageManager() || 'pnpm';
|
||||
|
||||
afterEach(() => cleanupProject());
|
||||
|
||||
it('should be able to create a plugin repo and run plugin e2e', () => {
|
||||
const wsName = uniq('ws-plugin');
|
||||
const pluginName = uniq('plugin');
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import {
|
||||
checkFilesDoNotExist,
|
||||
checkFilesExist,
|
||||
cleanupProject,
|
||||
e2eCwd,
|
||||
expectNoAngularDevkit,
|
||||
expectNoTsJestInJestConfig,
|
||||
@ -20,6 +21,8 @@ import { execSync } from 'child_process';
|
||||
describe('create-nx-workspace', () => {
|
||||
const packageManager = getSelectedPackageManager() || 'pnpm';
|
||||
|
||||
afterEach(() => cleanupProject());
|
||||
|
||||
it('should be able to create an empty workspace built for apps', () => {
|
||||
const wsName = uniq('apps');
|
||||
runCreateWorkspace(wsName, {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user