[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

chore(ui): include test and custom types (#5940)

authored by

Joaquín Sánchez and committed by
GitHub
(Jun 20, 2024, 5:27 PM +0200) a17635be 7ae160ba

+17 -2
+8
packages/ui/client/composables/explorer/types.ts
··· 37 37 duration?: number 38 38 } 39 39 40 + export interface TestTreeNode extends UITaskTreeNode { 41 + type: 'test' 42 + } 43 + 44 + export interface CustomTestTreeNode extends UITaskTreeNode { 45 + type: 'custom' 46 + } 47 + 40 48 export interface ParentTreeNode extends UITaskTreeNode { 41 49 children: Set<string> 42 50 tasks: UITaskTreeNode[]
+9 -2
packages/ui/client/composables/explorer/utils.ts
··· 1 1 import type { File, Task } from '@vitest/runner' 2 2 import { isAtomTest } from '@vitest/runner/utils' 3 - import type { FileTreeNode, ParentTreeNode, SuiteTreeNode, UITaskTreeNode } from '~/composables/explorer/types' 3 + import type { 4 + CustomTestTreeNode, 5 + FileTreeNode, 6 + ParentTreeNode, 7 + SuiteTreeNode, 8 + TestTreeNode, 9 + UITaskTreeNode, 10 + } from '~/composables/explorer/types' 4 11 import { client } from '~/composables/client' 5 12 import { getProjectNameColor, isSuite as isTaskSuite } from '~/utils/task' 6 13 import { explorerTree } from '~/composables/explorer/index' 7 14 import { openedTreeItemsSet } from '~/composables/explorer/state' 8 15 9 - export function isTestNode(node: UITaskTreeNode): node is FileTreeNode { 16 + export function isTestNode(node: UITaskTreeNode): node is TestTreeNode | CustomTestTreeNode { 10 17 return node.type === 'test' || node.type === 'custom' 11 18 } 12 19