Skip to content

Commit

Permalink
Merge branch 'main' into feat-expect-oneof
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa authored Dec 20, 2024
2 parents ef967e6 + 78b62ff commit 6f21c89
Show file tree
Hide file tree
Showing 141 changed files with 3,345 additions and 1,670 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,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 @@ -133,10 +133,6 @@ jobs:
os:
- macos-latest
- windows-latest
browser:
- [chromium, chrome]
- [firefox, firefox]
- [webkit]
fail-fast: false

timeout-minutes: 30
Expand All @@ -149,26 +145,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] }}
33 changes: 33 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,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 Down Expand Up @@ -214,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 @@ -245,6 +267,17 @@ export default ({ mode }: { mode: string }) => {
},
],
},
{
text: 'Guides',
collapsed: false,
items: [
{
text: 'Multiple Setups',
link: '/guide/browser/multiple-setups',
docFooterText: 'Multiple Setups | Browser Mode',
},
],
},
{
items: [
...footer(),
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
9 changes: 8 additions & 1 deletion docs/advanced/api/vitest.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Vitest 3 is one step closer to stabilising the public API. To achieve that, we d
- `changeNamePattern`
- `changeFilenamePattern`
- `rerunFailed`
- `updateSnapshot`
- `_createRootProject` (renamed to `_ensureRootProject`, but still private)
- `filterTestsBySource` (this was moved to the new internal `vitest.specifications` instance)
- `runFiles` (use [`runTestSpecifications`](#runtestspecifications) instead)
Expand Down Expand Up @@ -326,6 +325,14 @@ function runTestSpecifications(

This method emits `reporter.onWatcherRerun` and `onTestsRerun` events, then it runs tests with [`runTestSpecifications`](#runtestspecifications). If there were no errors in the main process, it will emit `reporter.onWatcherStart` event.

## updateSnapshot

```ts
function updateSnapshot(files?: string[]): Promise<TestRunResult>
```

Update snapshots in specified files. If no files are provided, it will update files with failed tests and obsolete snapshots.

## collectTests

```ts
Expand Down
18 changes: 9 additions & 9 deletions docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ test.skipIf(isDev)('prod only test', () => {
```

::: warning
You cannot use this syntax, when using Vitest as [type checker](/guide/testing-types).
You cannot use this syntax when using Vitest as [type checker](/guide/testing-types).
:::

### test.runIf
Expand All @@ -166,7 +166,7 @@ test.runIf(isDev)('dev only test', () => {
```

::: warning
You cannot use this syntax, when using Vitest as [type checker](/guide/testing-types).
You cannot use this syntax when using Vitest as [type checker](/guide/testing-types).
:::

### test.only
Expand Down Expand Up @@ -231,7 +231,7 @@ test.concurrent('test 2', async ({ expect }) => {
```

::: warning
You cannot use this syntax, when using Vitest as [type checker](/guide/testing-types).
You cannot use this syntax when using Vitest as [type checker](/guide/testing-types).
:::

### test.sequential
Expand Down Expand Up @@ -289,7 +289,7 @@ test.fails('fail test', async () => {
```

::: warning
You cannot use this syntax, when using Vitest as [type checker](/guide/testing-types).
You cannot use this syntax when using Vitest as [type checker](/guide/testing-types).
:::

### test.each
Expand Down Expand Up @@ -390,7 +390,7 @@ Vitest processes `$values` with Chai `format` method. If the value is too trunca
:::

::: warning
You cannot use this syntax, when using Vitest as [type checker](/guide/testing-types).
You cannot use this syntax when using Vitest as [type checker](/guide/testing-types).
:::

### test.for
Expand Down Expand Up @@ -800,7 +800,7 @@ describe.runIf(isDev)('dev only test suite', () => {
```

::: warning
You cannot use this syntax, when using Vitest as [type checker](/guide/testing-types).
You cannot use this syntax when using Vitest as [type checker](/guide/testing-types).
:::

### describe.only
Expand Down Expand Up @@ -874,7 +874,7 @@ describe.concurrent('suite', () => {
```

::: warning
You cannot use this syntax, when using Vitest as [type checker](/guide/testing-types).
You cannot use this syntax when using Vitest as [type checker](/guide/testing-types).
:::

### describe.sequential
Expand Down Expand Up @@ -930,7 +930,7 @@ describe.shuffle('suite', () => {
`.skip`, `.only`, and `.todo` works with random suites.

::: warning
You cannot use this syntax, when using Vitest as [type checker](/guide/testing-types).
You cannot use this syntax when using Vitest as [type checker](/guide/testing-types).
:::

### describe.todo
Expand Down Expand Up @@ -995,7 +995,7 @@ describe.each`
```

::: warning
You cannot use this syntax, when using Vitest as [type checker](/guide/testing-types).
You cannot use this syntax when using Vitest as [type checker](/guide/testing-types).
:::

## Setup and Teardown
Expand Down
Loading

0 comments on commit 6f21c89

Please sign in to comment.