Skip to content

Commit 8653dca

Browse files
committed
clean up test fail logs
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent a205435 commit 8653dca

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

src/commands.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ interface CreateCommandProps {
2121
}
2222

2323
let sendToClient = (action: T.Action): void => {
24-
// function is replaced when webclient loads
24+
// function is replaced when webview mounts
2525
}
2626

2727
// This makes it easier to pass the send
2828
// function throughout the codebase
2929
export const send = (action: T.Action): void => {
30-
logger(`EXT TO CLIENT: "${typeof action === 'string' ? action : action.type}"`)
31-
32-
if (action) sendToClient(action)
30+
// log send of event to client
31+
logger(`${typeof action === 'string' ? action : action.type}`)
32+
sendToClient(action)
3333
}
3434

3535
export const createCommands = (commandProps: CreateCommandProps): { [key: string]: any } => {
@@ -91,7 +91,7 @@ export const createCommands = (commandProps: CreateCommandProps): { [key: string
9191
},
9292
onRun: (position: T.Position) => {
9393
// send test run message back to client
94-
send({ type: 'TEST_RUNNING', payload: { position } })
94+
send({ type: 'START_TEST', payload: { position } })
9595
},
9696
onLoadSubtasks: ({ summary }) => {
9797
send({ type: 'LOAD_SUBTASK_RESULTS', payload: { summary } })

src/services/testRunner/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const createTestRunner = (data: TT.Tutorial, callbacks: Callbacks): ((params: an
7272
command = [command, testRunnerFilterArg, testFilter].join(' ')
7373
}
7474
}
75-
logger('COMMAND', command)
75+
logger(`COMMAND: ${command}`)
7676
result = await exec({ command, dir: testRunnerConfig.directory })
7777
} catch (err: any) {
7878
result = { stdout: err.stdout, stderr: err.stack }
@@ -84,13 +84,15 @@ const createTestRunner = (data: TT.Tutorial, callbacks: Callbacks): ((params: an
8484
return
8585
}
8686

87-
logger('----------------- PROCESS TEST -----------------')
87+
logger('---------------- TEST RESULTS -----------------')
8888

8989
const { stdout, stderr } = result
9090

9191
const tap: ParserOutput = parser(stdout || '')
9292

93-
logger(tap.logs.join('\n'))
93+
if (tap.logs.length) {
94+
logger(tap.logs.join('\n'))
95+
}
9496

9597
if (stderr) {
9698
if (!tap.failed.length) {

web-app/src/services/state/machine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export const createMachine = (options: any) => {
157157
LOAD_SUBTASK_RESULTS: {
158158
actions: ['testSubtasks'],
159159
},
160-
TEST_RUNNING: 'TestRunning',
160+
START_TEST: 'TestRunning',
161161
STEP_SOLUTION_LOAD: {
162162
actions: ['editorLoadSolution'],
163163
},

0 commit comments

Comments
 (0)