Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
keroxp committed Feb 19, 2024
1 parent 88c9dcc commit f8f7a7c
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,23 @@ export function syncTestStatusToVsCode(
) {
const groups = groupTasksByPattern(new Map(), vscodeFile.children, vitestFile.tasks)
for (const [data, tasks] of groups.entries()) {
if (finished) {
for (const task of tasks) {
if (!task.logs)
continue
// for now, display logs after all tests are finished.
// TODO: append logs during test execution using `onUserConsoleLog` rpc.
for (const log of task.logs) {
// LF to CRLF https://code.visualstudio.com/api/extension-guides/testing#test-output
const output = log.content.replace(/(?<!\r)\n/g, '\r\n')
run.appendOutput(output, undefined, data.item)
}
}
}
const primaryTask = getPrimaryResultTask(tasks)
if (primaryTask?.result == null) {
if (finished) {
finishedTest && finishedTest.add(data.item)
finishedTest?.add(data.item)
run.skipped(data.item)
}
else if (isFirstUpdate) {
Expand Down Expand Up @@ -451,7 +464,7 @@ function matchTask(
if (task.type === 'suite' && !(vscode instanceof TestDescribe))
continue

if (task.type === 'test' && !(vscode instanceof TestCase))
if ((task.type === 'test' || task.type === 'custom') && !(vscode instanceof TestCase))
continue

const fullTaskName = getFullTaskName(task)
Expand Down

0 comments on commit f8f7a7c

Please sign in to comment.