Skip to content

Commit

Permalink
Merge branch 'main' into feature/get-next-mock-implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
chaptergy authored Jan 6, 2025
2 parents eaee0c2 + d262e05 commit 439e280
Show file tree
Hide file tree
Showing 345 changed files with 10,621 additions and 5,323 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/bench.yml

This file was deleted.

21 changes: 7 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ jobs:
- name: Build
run: pnpm run build

# check uncommited LICENSE.md, auto-imports.d.ts, etc...
- name: Check stale build artifacts
run: git diff --exit-code

- name: Lint
run: pnpm run lint

Expand All @@ -61,7 +65,7 @@ jobs:

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@4edd678ac3f81e2dc578756871e4d00c19191daf # v45.0.4
uses: tj-actions/changed-files@bab30c2299617f6615ec02a68b9a40d10bd21366 # v45.0.5
with:
files: |
docs/**
Expand Down Expand Up @@ -117,7 +121,7 @@ jobs:

test-browser:
needs: changed
name: 'Browser: ${{ matrix.browser[0] }}, ${{ matrix.os }}'
name: 'Browsers: node-20, ${{ matrix.os }}'
if: needs.changed.outputs.should_skip != 'true'

runs-on: ${{ matrix.os }}
Expand All @@ -126,10 +130,6 @@ jobs:
os:
- macos-latest
- windows-latest
browser:
- [chromium, chrome]
- [firefox, firefox]
- [webkit]
fail-fast: false

timeout-minutes: 30
Expand All @@ -142,26 +142,19 @@ jobs:
node-version: 20

- uses: browser-actions/setup-chrome@v1
if: ${{ matrix.browser[0] == 'chromium' }}
- uses: browser-actions/setup-firefox@v1
if: ${{ matrix.browser[0] == 'firefox' }}

- name: Install
run: pnpm i

- name: Install Playwright Dependencies
run: pnpm exec playwright install ${{ matrix.browser[0] }} --with-deps --only-shell
run: pnpm exec playwright install --with-deps --only-shell

- name: Build
run: pnpm run build

- name: Test Browser (playwright)
run: pnpm run test:browser:playwright
env:
BROWSER: ${{ matrix.browser[0] }}

- name: Test Browser (webdriverio)
run: pnpm run test:browser:webdriverio
if: ${{ matrix.browser[1] }}
env:
BROWSER: ${{ matrix.browser[1] }}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"json",
"jsonc",
"yaml"
]
],
"testing.automaticallyOpenTestResults": "neverOpen"
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<p align="center">
<a href="https://vitest.dev">
<img src="https://user-images.githubusercontent.com/11247099/145112184-a9ff6727-661c-439d-9ada-963124a281f7.png" height="150">
</a>
</p>

<h1 align="center">
Expand Down
140 changes: 116 additions & 24 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { transformerTwoslash } from '@shikijs/vitepress-twoslash'
import { transformerNotationWordHighlight } from '@shikijs/transformers'
import { withPwa } from '@vite-pwa/vitepress'
import type { DefaultTheme } from 'vitepress'
import { defineConfig } from 'vitepress'
Expand Down Expand Up @@ -66,6 +67,7 @@ export default ({ mode }: { mode: string }) => {
groupIconVitePlugin({
customIcon: {
'CLI': 'vscode-icons:file-type-shell',
'vitest.shims': 'vscode-icons:file-type-vitest',
'vitest.workspace': 'vscode-icons:file-type-vitest',
'vitest.config': 'vscode-icons:file-type-vitest',
'.spec.ts': 'vscode-icons:file-type-testts',
Expand All @@ -87,8 +89,9 @@ export default ({ mode }: { mode: string }) => {
dark: 'github-dark',
},
codeTransformers: mode === 'development'
? []
? [transformerNotationWordHighlight()]
: [
transformerNotationWordHighlight(),
transformerTwoslash({
processHoverInfo: (info) => {
if (info.includes(process.cwd())) {
Expand Down Expand Up @@ -146,7 +149,7 @@ export default ({ mode }: { mode: string }) => {
items: [
{
text: 'Advanced API',
link: '/advanced/api',
link: '/advanced/api/',
activeMatch: '^/advanced/',
},
{
Expand Down Expand Up @@ -212,6 +215,27 @@ export default ({ mode }: { mode: string }) => {
},
],
},
{
text: 'Configuration',
collapsed: false,
items: [
{
text: 'Browser Config Reference',
link: '/guide/browser/config',
docFooterText: 'Browser Config Reference | Browser Mode',
},
{
text: 'Configuring Playwright',
link: '/guide/browser/playwright',
docFooterText: 'Configuring Playwright | Browser Mode',
},
{
text: 'Configuring WebdriverIO',
link: '/guide/browser/webdriverio',
docFooterText: 'Configuring WebdriverIO | Browser Mode',
},
],
},
{
text: 'API',
collapsed: false,
Expand Down Expand Up @@ -243,16 +267,73 @@ export default ({ mode }: { mode: string }) => {
},
],
},
footer(),
{
text: 'Guides',
collapsed: false,
items: [
{
text: 'Multiple Setups',
link: '/guide/browser/multiple-setups',
docFooterText: 'Multiple Setups | Browser Mode',
},
],
},
{
items: [
...footer(),
{
text: 'Node API Reference',
link: '/advanced/api/',
},
],
},
],
'/advanced': [
{
text: 'API',
collapsed: false,
items: [
{
text: 'Vitest Node API',
link: '/advanced/api',
text: 'Node API',
items: [
{
text: 'Getting Started',
link: '/advanced/api/',
},
{
text: 'Vitest',
link: '/advanced/api/vitest',
},
{
text: 'TestProject',
link: '/advanced/api/test-project',
},
{
text: 'TestSpecification',
link: '/advanced/api/test-specification',
},
],
},
{
text: 'Test Task API',
items: [
{
text: 'TestCase',
link: '/advanced/api/test-case',
},
{
text: 'TestSuite',
link: '/advanced/api/test-suite',
},
{
text: 'TestModule',
link: '/advanced/api/test-module',
},
{
text: 'TestCollection',
link: '/advanced/api/test-collection',
},
],
},
{
text: 'Runner API',
Expand Down Expand Up @@ -282,7 +363,9 @@ export default ({ mode }: { mode: string }) => {
},
],
},
footer(),
{
items: footer(),
},
],
'/team': [],
'/': [
Expand All @@ -308,7 +391,7 @@ export default ({ mode }: { mode: string }) => {
link: '/guide/browser',
},
{
text: 'Advanced API',
text: 'Node API Reference',
link: '/advanced/api',
},
{
Expand All @@ -325,19 +408,17 @@ export default ({ mode }: { mode: string }) => {
}))
}

function footer(): DefaultTheme.SidebarItem {
return {
items: [
{
text: 'Config Reference',
link: '/config/',
},
{
text: 'Test API Reference',
link: '/api/',
},
],
}
function footer(): DefaultTheme.SidebarItem[] {
return [
{
text: 'Config Reference',
link: '/config/',
},
{
text: 'Test API Reference',
link: '/api/',
},
]
}

function introduction(): DefaultTheme.SidebarItem[] {
Expand Down Expand Up @@ -423,14 +504,25 @@ function guide(): DefaultTheme.SidebarItem[] {
text: 'Debugging',
link: '/guide/debugging',
},
{
text: 'Migration Guide',
link: '/guide/migration',
},
{
text: 'Common Errors',
link: '/guide/common-errors',
},
{
text: 'Migration Guide',
link: '/guide/migration',
collapsed: false,
items: [
{
text: 'Migrating to Vitest 3.0',
link: '/guide/migration#vitest-3',
},
{
text: 'Migrating from Jest',
link: '/guide/migration#jest',
},
],
},
{
text: 'Performance',
collapsed: false,
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/scripts/cli-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const options = resolveOptions(cliOptionsConfig)
const template = options.map((option) => {
const title = option.title
const cli = option.cli
const config = skipConfig.has(title) ? '' : `[${title}](/config/#${title.toLowerCase().replace(/\./g, '-')})`
const config = skipConfig.has(title) ? '' : `[${title}](${title.includes('browser.') ? '/guide/browser/config' : '/config/'}#${title.toLowerCase().replace(/\./g, '-')})`
return `### ${title}\n\n- **CLI:** ${cli}\n${config ? `- **Config:** ${config}\n` : ''}\n${option.description}\n`
}).join('\n')

Expand Down
6 changes: 6 additions & 0 deletions docs/.vitepress/style/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,9 @@ img.resizable-img {
min-height: unset;
}
}

.highlighted-word {
background-color: var(--vp-code-line-highlight-color);
transition: background-color 0.5s;
display: inline-block;
}
Loading

0 comments on commit 439e280

Please sign in to comment.