diff --git a/src/services/testRunner/index.ts b/src/services/testRunner/index.ts index 93cb3a64..0cbd6cde 100644 --- a/src/services/testRunner/index.ts +++ b/src/services/testRunner/index.ts @@ -3,7 +3,7 @@ import logger from '../../services/logger' import parser from './parser' import { debounce, throttle } from './throttle' import onError from '../sentry/onError' -import displayOutput from './output' +import { clearOutput, displayOutput } from './output' export interface Payload { stepId: string @@ -68,6 +68,7 @@ const createTestRunner = (config: TestRunnerConfig, callbacks: Callbacks) => { // success! if (tap.ok) { + clearOutput() callbacks.onSuccess(payload) if (onSuccess) { onSuccess() diff --git a/src/services/testRunner/output.ts b/src/services/testRunner/output.ts index 9640e328..ce988d5c 100644 --- a/src/services/testRunner/output.ts +++ b/src/services/testRunner/output.ts @@ -9,7 +9,7 @@ const getOutputChannel = (name: string): vscode.OutputChannel => { return channel } -const outputChannelName = 'TEST_OUTPUT' +const outputChannelName = 'CodeRoad Output' const parseOutput = (text: string): string => { let result = '' @@ -21,11 +21,17 @@ const parseOutput = (text: string): string => { return result } -const displayOutput = (text: string) => { +export const displayOutput = (text: string) => { const channel = getOutputChannel(outputChannelName) + channel.clear() channel.show(true) const output = parseOutput(text) channel.append(output) } -export default displayOutput +export const clearOutput = () => { + const channel = getOutputChannel(outputChannelName) + channel.show(false) + channel.clear() + channel.hide() +}