Assign of revertMethods instead of copying

This commit is contained in:
Ilya Goncharov
2019-09-28 16:18:57 +03:00
parent 9a5f937f2d
commit 842cbf51c9
@@ -78,7 +78,7 @@ export function runWithTeamCityReporter(
const startTime = timer ? timer.start() : null;
teamCity.sendMessage('testStarted', withName(name));
const revertLogMethods: CallableFunction[] = [];
let revertLogMethods: CallableFunction[] = [];
try {
runner.test(name, isIgnored, () => {
@@ -100,13 +100,12 @@ export function runWithTeamCityReporter(
[method: string]: (message?: any, ...optionalParams: any[]) => void
};
logMethods
revertLogMethods = logMethods
.map(method => {
const realMethod = globalConsole[method];
globalConsole[method] = log(method);
return () => globalConsole[method] = realMethod
})
.forEach(method => revertLogMethods.push(method));
});
fn();
});
} catch (e) {