From 842cbf51c9fb86ea7d0b812abe73bf1e2397225e Mon Sep 17 00:00:00 2001 From: Ilya Goncharov Date: Sat, 28 Sep 2019 16:18:57 +0300 Subject: [PATCH] Assign of revertMethods instead of copying --- .../src/KotlinTestTeamCityReporter.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libraries/tools/kotlin-test-js-runner/src/KotlinTestTeamCityReporter.ts b/libraries/tools/kotlin-test-js-runner/src/KotlinTestTeamCityReporter.ts index fcbfb36f7d5..4d1803e9753 100644 --- a/libraries/tools/kotlin-test-js-runner/src/KotlinTestTeamCityReporter.ts +++ b/libraries/tools/kotlin-test-js-runner/src/KotlinTestTeamCityReporter.ts @@ -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) {