Assign of revertMethods instead of copying
This commit is contained in:
@@ -78,7 +78,7 @@ export function runWithTeamCityReporter(
|
|||||||
const startTime = timer ? timer.start() : null;
|
const startTime = timer ? timer.start() : null;
|
||||||
teamCity.sendMessage('testStarted', withName(name));
|
teamCity.sendMessage('testStarted', withName(name));
|
||||||
|
|
||||||
const revertLogMethods: CallableFunction[] = [];
|
let revertLogMethods: CallableFunction[] = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
runner.test(name, isIgnored, () => {
|
runner.test(name, isIgnored, () => {
|
||||||
@@ -100,13 +100,12 @@ export function runWithTeamCityReporter(
|
|||||||
[method: string]: (message?: any, ...optionalParams: any[]) => void
|
[method: string]: (message?: any, ...optionalParams: any[]) => void
|
||||||
};
|
};
|
||||||
|
|
||||||
logMethods
|
revertLogMethods = logMethods
|
||||||
.map(method => {
|
.map(method => {
|
||||||
const realMethod = globalConsole[method];
|
const realMethod = globalConsole[method];
|
||||||
globalConsole[method] = log(method);
|
globalConsole[method] = log(method);
|
||||||
return () => globalConsole[method] = realMethod
|
return () => globalConsole[method] = realMethod
|
||||||
})
|
});
|
||||||
.forEach(method => revertLogMethods.push(method));
|
|
||||||
fn();
|
fn();
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user