mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-15 18:13:38 +08:00
test: revert local test project file changes on test completion
This commit is contained in:
parent
96d39f8f3a
commit
2e4925b6d6
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user