Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .vitepress/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
// biome-ignore lint: disable
export {}

/* prettier-ignore */
declare module 'vue' {
export interface GlobalComponents {
Advanced: typeof import('./components/Advanced.vue')['default']
ArrowDown: typeof import('./components/ArrowDown.vue')['default']
BlogIndex: typeof import('./components/BlogIndex.vue')['default']
Box: typeof import('./components/Box.vue')['default']
Contributors: typeof import('./components/Contributors.vue')['default']
CourseLink: typeof import('./components/CourseLink.vue')['default']
CRoot: typeof import('./components/CRoot.vue')['default']
Deprecated: typeof import('./components/Deprecated.vue')['default']
Experimental: typeof import('./components/Experimental.vue')['default']
FeaturesList: typeof import('./components/FeaturesList.vue')['default']
HomePage: typeof import('./components/HomePage.vue')['default']
ListItem: typeof import('./components/ListItem.vue')['default']
Expand Down
5 changes: 5 additions & 0 deletions .vitepress/components/Advanced.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<Badge type="danger" title="This is an advanced API intended for library authors and framework integrations. Most users should not need this." class="cursor-help">
advanced
</Badge>
</template>
5 changes: 5 additions & 0 deletions .vitepress/components/CRoot.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<Badge type="warning" title="This options is only available in the top level config. You cannot specify it as an option of a test project." class="underline decoration-dotted cursor-help">
<div i-carbon:document-configuration class="my-1 -mx-1" />
</Badge>
</template>
5 changes: 5 additions & 0 deletions .vitepress/components/Deprecated.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<Badge type="danger">
deprecated
</Badge>
</template>
5 changes: 5 additions & 0 deletions .vitepress/components/Experimental.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<Badge type="warning" title="This feature is experimental and does not follow SemVer." class="cursor-help">
experimental
</Badge>
</template>
88 changes: 28 additions & 60 deletions .vitepress/components/FeaturesList.vue
Original file line number Diff line number Diff line change
@@ -1,64 +1,32 @@
<template>
<ul class="features-list" dir="auto" flex="~ col gap2 md:gap-3">
<ListItem>
<a target="_blank" href="https://vitejs.dev" rel="noopener noreferrer">Vite</a>
通用的配置、转换器、解析器和插件。
</ListItem>
<ListItem>使用与你的应用相同的设置来运行测试!</ListItem>
<ListItem>智能文件监听模式,就像是测试的 HMR!</ListItem>
<ListItem>支持对 Vue、React、Svelte、Lit 等框架进行组件测试。</ListItem>
<ListItem>开箱即用的 TypeScript / JSX 支持</ListItem>
<ListItem>ESM 优先,支持模块顶级 await</ListItem>
<ListItem>
通过
<a target="_blank" href="https://github.com/tinylibs/tinypool" rel="noopener noreferrer">Tinypool</a>
使用 Worker 线程并行执行测试
</ListItem>
<ListItem>
使用
<a target="_blank" href="https://github.com/tinylibs/tinybench" rel="noopener noreferrer">Tinybench</a>
支持基准测试
</ListItem>
<ListItem>支持套件和测试的过滤、超时、并发配置</ListItem>
<ListItem>支持 <a href="/guide/projects">Projects</a> / <a href="/guide/workspace">Workspace</a></ListItem>
<ListItem>
<a href="/guide/snapshot">Jest 快照功能</a>
</ListItem>
<ListItem>
内置
<a target="_blank" href="https://www.chaijs.com/" rel="noopener noreferrer">Chai</a>
进行断言,并兼容
<a target="_blank" href="https://jestjs.io/zh-Hans/docs/expect" rel="noopener noreferrer">Jest expect</a> API
</ListItem>
<ListItem>
内置
<a target="_blank" href="https://github.com/Aslemammad/tinyspy" rel="noopener noreferrer">Tinyspy</a> 用于对象 Mock
</ListItem>
<ListItem>
使用
<a target="_blank" href="https://github.com/jsdom/jsdom" rel="noopener noreferrer">jsdom</a> 或
<a target="_blank" href="https://github.com/capricorn86/happy-dom" rel="noopener noreferrer">happy-dom</a>
模拟 DOM
</ListItem>
<ListItem><a href="/guide/browser/" rel="noopener noreferrer">浏览器模式</a>:在浏览器中运行组件测试</ListItem>
<ListItem>
通过
<a target="_blank" href="https://v8.dev/blog/javascript-code-coverage" rel="noopener noreferrer">v8</a>
<a target="_blank" href="https://istanbul.js.org/" rel="noopener noreferrer">istanbul</a> 输出代码覆盖率
</ListItem>
<ListItem>
类似 Rust 的
<a href="/guide/in-source" rel="noopener noreferrer">源码内联测试</a>
</ListItem>
<ListItem>
使用
<a target="_blank" href="https://github.com/mmkal/expect-type" rel="noopener noreferrer">expect-type</a>
进行类型测试
</ListItem>
<ListItem>支持分片执行</ListItem>
<ListItem>报告未捕获的错误</ListItem>
<ul
class="features-list"
dir="auto"
flex="~ col gap2 md:gap-3"
>
<ListItem><a target="_blank" href="https://vitejs.dev" rel="noopener noreferrer">Vite</a>'s config, transformers, resolvers, and plugins</ListItem>
<ListItem>Use the same setup from your app to run the tests!</ListItem>
<ListItem>Smart & instant watch mode, like HMR for tests!</ListItem>
<ListItem>Component testing for Vue, React, Svelte, Lit, Marko and more</ListItem>
<ListItem>Out-of-the-box TypeScript / JSX support</ListItem>
<ListItem>ESM first, top level await</ListItem>
<ListItem>Benchmarking support with <a target="_blank" href="https://github.com/tinylibs/tinybench" rel="noopener noreferrer">Tinybench</a></ListItem>
<ListItem>Filtering, timeouts, concurrent for suite and tests</ListItem>
<ListItem><a href="/guide/projects">Projects</a> support</ListItem>
<ListItem>
<a href="/guide/snapshot">
Jest-compatible Snapshot
</a>
</ListItem>
<ListItem><a target="_blank" href="https://www.chaijs.com/" rel="noopener noreferrer">Chai</a> built-in for assertions + <a target="_blank" href="https://jestjs.io/docs/expect" rel="noopener noreferrer">Jest expect</a> compatible APIs</ListItem>
<ListItem><a target="_blank" href="https://github.com/tinylibs/tinyspy" rel="noopener noreferrer">Tinyspy</a> built-in for mocking</ListItem>
<ListItem><a target="_blank" href="https://github.com/capricorn86/happy-dom" rel="noopener noreferrer">happy-dom</a> or <a target="_blank" href="https://github.com/jsdom/jsdom" rel="noopener noreferrer">jsdom</a> for DOM mocking</ListItem>
<ListItem><a href="https://vitest.dev/guide/browser/" rel="noopener noreferrer">Browser Mode</a> for running component tests in the browser</ListItem>
<ListItem>Code coverage via <a target="_blank" href="https://v8.dev/blog/javascript-code-coverage" rel="noopener noreferrer">v8</a> or <a target="_blank" href="https://istanbul.js.org/" rel="noopener noreferrer">istanbul</a></ListItem>
<ListItem>Rust-like <a href="/guide/in-source">in-source testing</a></ListItem>
<ListItem>Type Testing via <a target="_blank" href="https://github.com/mmkal/expect-type" rel="noopener noreferrer">expect-type</a></ListItem>
<ListItem>Sharding Support</ListItem>
<ListItem>Reporting Uncaught Errors</ListItem>
</ul>
</template>

Expand Down
17 changes: 7 additions & 10 deletions .vitepress/components/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { sponsors } from '../sponsors'
<main class="main">
<VPHomeSponsors
v-if="sponsors"
message="Vitest 是优秀的开源软件,这得益于这些出色的赞助商。"
message="Vitest is free and open source, made possible by wonderful sponsors."
:data="sponsors"
/>
<div class="action">
Expand All @@ -19,18 +19,12 @@ import { sponsors } from '../sponsors'
target="_blank"
rel="noreferrer"
>
赞助 Vitest
Sponsor Vitest
</a>
</div>
<p flex flex-col items-center mt-10 class="text-center opacity-75">
<a href="https://www.netlify.com" rel="noopener noreferrer">
<img
src="/netlify.svg"
alt="Deploys by Netlify"
width="114"
height="151"
decoding="async"
>
<img src="/netlify.svg" alt="Deploys by Netlify" width="114" height="151" decoding="async">
</a>
</p>
</main>
Expand All @@ -53,7 +47,10 @@ import { sponsors } from '../sponsors'
text-align: center;
font-weight: 600;
white-space: nowrap;
transition: color 0.25s, border-color 0.25s, background-color 0.25s;
transition:
color 0.25s,
border-color 0.25s,
background-color 0.25s;
/* .VPButton.medium */
border-radius: 20px;
padding: 0 20px;
Expand Down
9 changes: 8 additions & 1 deletion .vitepress/components/Version.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<script setup lang="ts">
import { VPBadge } from 'vitepress/theme'

const { type = 'stable' } = defineProps<{
type?: 'stable' | 'experimental'
}>()
</script>

<template>
<VPBadge type="info">
<VPBadge
:type="type === 'experimental' ? 'warning' : 'info'"
:title="type === 'experimental' ? 'This feature is experimental and does not follow SemVer.' : undefined"
>
<slot />+
</VPBadge>
</template>
Loading