Skip to content

Commit

Permalink
test: revert local test project file changes on test completion
Browse files Browse the repository at this point in the history
  • Loading branch information
jbedard authored and alan-agius4 committed Jul 28, 2022
1 parent 96d39f8 commit 2e4925b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
18 changes: 10 additions & 8 deletions tests/legacy-cli/e2e/tests/misc/supported-angular.ts
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
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

0 comments on commit 2e4925b

Please sign in to comment.