"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/legacy-cli/e2e_runner.ts" between
angular-cli-12.1.2.tar.gz and angular-cli-12.1.3.tar.gz

About: Angular CLI is a command line interface for Angular.

e2e_runner.ts  (angular-cli-12.1.2):e2e_runner.ts  (angular-cli-12.1.3)
skipping to change at line 144 skipping to change at line 144
let absoluteName = path.join(e2eRoot, relativeName); let absoluteName = path.join(e2eRoot, relativeName);
if (/^win/.test(process.platform)) { if (/^win/.test(process.platform)) {
absoluteName = absoluteName.replace(/\\/g, path.posix.sep); absoluteName = absoluteName.replace(/\\/g, path.posix.sep);
} }
return previous.then(() => { return previous.then(() => {
currentFileName = relativeName.replace(/\.ts$/, ''); currentFileName = relativeName.replace(/\.ts$/, '');
const start = +new Date(); const start = +new Date();
const module = require(absoluteName); const module = require(absoluteName);
const originalEnvVariables = {
...process.env,
};
const fn: (skipClean?: () => void) => Promise<void> | void = const fn: (skipClean?: () => void) => Promise<void> | void =
typeof module == 'function' typeof module == 'function'
? module ? module
: typeof module.default == 'function' : typeof module.default == 'function'
? module.default ? module.default
: () => { : () => {
throw new Error('Invalid test module.'); throw new Error('Invalid test module.');
}; };
let clean = true; let clean = true;
skipping to change at line 172 skipping to change at line 176
() => logStack.pop(), () => logStack.pop(),
(err) => { (err) => {
logStack.pop(); logStack.pop();
throw err; throw err;
}, },
) )
.then(() => console.log('----')) .then(() => console.log('----'))
.then(() => { .then(() => {
// If we're not in a setup, change the directory back to where it was before the test. // If we're not in a setup, change the directory back to where it was before the test.
// This allows tests to chdir without worrying about keeping the origi nal directory. // This allows tests to chdir without worrying about keeping the origi nal directory.
if (allSetups.indexOf(relativeName) == -1 && previousDir) { if (!allSetups.includes(relativeName) && previousDir) {
process.chdir(previousDir); process.chdir(previousDir);
// Restore env variables before each test.
console.log(' Restoring original environment variables...');
process.env = originalEnvVariables;
} }
}) })
.then(() => { .then(() => {
// Only clean after a real test, not a setup step. Also skip cleaning if the test // Only clean after a real test, not a setup step. Also skip cleaning if the test
// requested an exception. // requested an exception.
if (allSetups.indexOf(relativeName) == -1 && clean) { if (!allSetups.includes(relativeName) && clean) {
logStack.push(new logging.NullLogger()); logStack.push(new logging.NullLogger());
return gitClean().then( return gitClean().then(
() => logStack.pop(), () => logStack.pop(),
(err) => { (err) => {
logStack.pop(); logStack.pop();
throw err; throw err;
}, },
); );
} }
}) })
.then( .then(
 End of changes. 5 change blocks. 
3 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)