Skip to content

Commit 2a8cb9d

Browse files
authored
feat: implement aroundEach and aroundAll hooks (#9450)
1 parent 5d0fd3b commit 2a8cb9d

37 files changed

+4267
-1522
lines changed

docs/.vitepress/config.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export default ({ mode }: { mode: string }) => {
154154
title: 'Vitest',
155155
items: [
156156
{ text: 'Guides', link: '/guide/' },
157-
{ text: 'API', link: '/api/' },
157+
{ text: 'API', link: '/api/test' },
158158
{ text: 'Config', link: '/config/' },
159159
],
160160
},
@@ -195,7 +195,7 @@ export default ({ mode }: { mode: string }) => {
195195

196196
nav: [
197197
{ text: 'Guides', link: '/guide/', activeMatch: '^/guide/' },
198-
{ text: 'API', link: '/api/', activeMatch: '^/api/' },
198+
{ text: 'API', link: '/api/test', activeMatch: '^/api/' },
199199
{ text: 'Config', link: '/config/', activeMatch: '^/config/' },
200200
{
201201
text: 'Blog',
@@ -961,7 +961,20 @@ export default ({ mode }: { mode: string }) => {
961961
'/api': [
962962
{
963963
text: 'Test API Reference',
964-
link: '/api/',
964+
items: [
965+
{
966+
text: 'Test',
967+
link: '/api/test',
968+
},
969+
{
970+
text: 'Describe',
971+
link: '/api/describe',
972+
},
973+
{
974+
text: 'Hooks',
975+
link: '/api/hooks',
976+
},
977+
],
965978
},
966979
{
967980
text: 'Mocks',

docs/.vitepress/theme/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ export default {
2525
return true
2626
}
2727
const url = new URL(to, location.href)
28+
if (url.pathname === '/api/' || url.pathname === '/api' || url.pathname === '/api/index.html') {
29+
setTimeout(() => { router.go(`/api/test`) })
30+
return false
31+
}
2832
if (!url.hash) {
2933
return true
3034
}

0 commit comments

Comments
 (0)