Skip to content

test: revert local test project file changes on test completion #23648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions tests/legacy-cli/e2e/tests/misc/supported-angular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ export default async function () {

// Major should succeed, but we don't need to test it here since it's tested everywhere else.
// Major+1 and -1 should fail architect commands, but allow other commands.
await fakeCoreVersion(cliMajor + 1);
await expectToFail(() => ng('build'), 'Should fail Major+1');
await ng('version');
await fakeCoreVersion(cliMajor - 1);
await ng('version');

// Restore the original core package.json.
await writeFile(angularCorePkgPath, originalAngularCorePkgJson);
try {
await fakeCoreVersion(cliMajor + 1);
await expectToFail(() => ng('build'), 'Should fail Major+1');
await ng('version');
await fakeCoreVersion(cliMajor - 1);
await ng('version');
} finally {
// Restore the original core package.json.
await writeFile(angularCorePkgPath, originalAngularCorePkgJson);
}
}
12 changes: 7 additions & 5 deletions tests/legacy-cli/e2e_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,15 @@ async function runInitializer(absoluteName: string) {
async function runTest(absoluteName: string) {
process.chdir(join(getGlobalVariable('projects-root'), 'test-project'));

await launchTestProcess(absoluteName);

logStack.push(new logging.NullLogger());
try {
await gitClean();
await launchTestProcess(absoluteName);
} finally {
logStack.pop();
logStack.push(new logging.NullLogger());
try {
await gitClean();
} finally {
logStack.pop();
}
}
}

Expand Down