Skip to content

closes #126. show/hide console on tests #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
closes #126. show/hide console on tests
  • Loading branch information
ShMcK committed Mar 8, 2020
commit 2bbea4f2fe8993716ebab041d956b7d5a45330b0
3 changes: 2 additions & 1 deletion src/services/testRunner/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -68,6 +68,7 @@ const createTestRunner = (config: TestRunnerConfig, callbacks: Callbacks) => {

// success!
if (tap.ok) {
clearOutput()
callbacks.onSuccess(payload)
if (onSuccess) {
onSuccess()
Expand Down
12 changes: 9 additions & 3 deletions src/services/testRunner/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand All @@ -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()
}