diff --git a/.gitignore b/.gitignore index d0949feffdb5..c5f2accdb089 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,6 @@ test/browser/fixtures/update-snapshot/basic.test.ts test/cli/fixtures/browser-multiple/basic-* .vitest-reports *.tsbuildinfo +# exclude static html reporter folder +test/browser/html/ +test/core/html/ diff --git a/packages/ui/client/composables/client/static.ts b/packages/ui/client/composables/client/static.ts index 044f249d8f6f..f957ca4b7075 100644 --- a/packages/ui/client/composables/client/static.ts +++ b/packages/ui/client/composables/client/static.ts @@ -58,6 +58,7 @@ export function createStaticClient(): VitestClient { onTaskUpdate: noop, writeFile: asyncNoop, rerun: asyncNoop, + rerunTask: asyncNoop, updateSnapshot: asyncNoop, resolveSnapshotPath: asyncNoop, snapshotSaved: asyncNoop, @@ -80,7 +81,7 @@ export function createStaticClient(): VitestClient { ctx.rpc = rpc as any as BirpcReturn - let openPromise: Promise + const openPromise = Promise.resolve() function reconnect() { registerMetadata() diff --git a/packages/ui/client/composables/explorer/search.ts b/packages/ui/client/composables/explorer/search.ts index e9a96d007398..15e63d7bc286 100644 --- a/packages/ui/client/composables/explorer/search.ts +++ b/packages/ui/client/composables/explorer/search.ts @@ -24,7 +24,7 @@ export function useSearch(searchBox: Ref) { const disableClearSearch = computed(() => search.value === '') const debouncedSearch = ref(search.value) - debouncedWatch(search, (value) => { + debouncedWatch(() => search.value, (value) => { debouncedSearch.value = value?.trim() ?? '' }, { debounce: 256 }) diff --git a/packages/ui/client/global-setup.ts b/packages/ui/client/global-setup.ts index 6c0f24837428..356e1010bde9 100644 --- a/packages/ui/client/global-setup.ts +++ b/packages/ui/client/global-setup.ts @@ -1,6 +1,7 @@ /// -import FloatingVue, { VTooltip } from 'floating-vue' +import type { Directive } from 'vue' +import FloatingVue, { vTooltip } from 'floating-vue' import routes from 'virtual:generated-pages' import { createRouter as _createRouter, @@ -15,8 +16,8 @@ import './styles/main.css' import 'floating-vue/dist/style.css' import 'uno.css' -export const directives = { - tooltip: VTooltip, +export const directives: Record = { + tooltip: vTooltip, } FloatingVue.options.instantMove = true diff --git a/packages/ui/client/test.ts b/packages/ui/client/test.ts index ca7c890c452b..08f599fb1d44 100644 --- a/packages/ui/client/test.ts +++ b/packages/ui/client/test.ts @@ -3,15 +3,15 @@ import { cleanup, type RenderOptions, } from '@testing-library/vue' -import { VTooltip } from 'floating-vue' +import { vTooltip } from 'floating-vue' import { afterEach } from 'vitest' -export function render(component: any, options?: RenderOptions) { +export function render(component: C, options?: RenderOptions) { return _render(component, { ...options, global: { directives: { - tooltip: VTooltip, + tooltip: vTooltip, }, }, }) diff --git a/test/browser/package.json b/test/browser/package.json index 0d9c6742185d..fa0e6093de85 100644 --- a/test/browser/package.json +++ b/test/browser/package.json @@ -18,7 +18,8 @@ "coverage": "vitest --coverage.enabled --coverage.provider=istanbul --browser.headless=yes", "test:browser:preview": "PROVIDER=preview vitest", "test:browser:playwright": "PROVIDER=playwright vitest", - "test:browser:webdriverio": "PROVIDER=webdriverio vitest" + "test:browser:webdriverio": "PROVIDER=webdriverio vitest", + "test:browser:playwright:html": "PROVIDER=playwright vitest --reporter=html" }, "devDependencies": { "@testing-library/react": "^13.2.0", diff --git a/test/browser/vitest.config.mts b/test/browser/vitest.config.mts index 0436736e63ec..82562c4625f7 100644 --- a/test/browser/vitest.config.mts +++ b/test/browser/vitest.config.mts @@ -102,7 +102,10 @@ export default defineConfig({ }, open: false, diff: './custom-diff-config.ts', - outputFile: './browser.json', + outputFile: { + html: './html/index.html', + json: './browser.json', + }, reporters: ['json', { onInit: noop, onPathsCollected: noop, diff --git a/test/core/package.json b/test/core/package.json index 8a058771180d..c112f6a9042b 100644 --- a/test/core/package.json +++ b/test/core/package.json @@ -4,6 +4,7 @@ "private": true, "scripts": { "test": "vitest", + "test:html": "vitest --reporter=html", "test:threads": "vitest --project threads", "test:forks": "vitest --project forks", "test:vmThreads": "vitest --project vmThreads", diff --git a/tsconfig.check.json b/tsconfig.check.json index fe3fa7d051bb..278ac220841f 100644 --- a/tsconfig.check.json +++ b/tsconfig.check.json @@ -11,7 +11,6 @@ "./packages/vitest/dist/**", "./packages/*/*.d.ts", "./packages/*/*.d.cts", - "./packages/ui/client/**", "./examples/**/*.*", "./bench/**", "./test/benchmark/fixtures/**",