Skip to content
Merged
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
2 changes: 1 addition & 1 deletion docs/config/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ outline: deep
- **Default:** `false`
- **CLI:** `--api`, `--api.port`, `--api.host`, `--api.strictPort`

Listen to port and serve API for [the UI](/guide/ui) or [browser server](/guide/browser/). When set to `true`, the default port is `51204` or `63315` if running in Browser Mode.
Listen to port and serve API for [the UI](/guide/ui) or [browser server](/guide/browser/). When set to `true`, the default port is `51204` or `23315` if running in Browser Mode.

In Browser Mode the server binds its port on the first browser launch, unless `api` or `ui` is enabled.

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/browser/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export default defineConfig({
```

::: info
Vitest assigns port `63315` to avoid conflicts with the development server, allowing you to run both in parallel. You can change that with the [`api`](/config/api) option. The port is bound when the first browser is launched, or on startup if `api` or `ui` is enabled.
Vitest assigns port `23315` to avoid conflicts with the development server, allowing you to run both in parallel. You can change that with the [`api`](/config/api) option. The port is bound when the first browser is launched, or on startup if `api` or `ui` is enabled.
:::

If you have not used Vite before, make sure you have your framework's plugin installed and specified in the config. Some frameworks might require extra configuration to work - check their Vite related documentation to be sure.
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/migration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ If you manually opened the browser preview by copying the Vite server URL or vis

## `browser.api` Is Replaced by the Top-Level `api`

Browser mode now runs on a single Vite server configured by the top-level [`api`](/config/api) option; the default port in browser mode is still `63315`. The `browser.api` option is deprecated and no longer has any effect, so move its value to `api`:
Browser mode now runs on a single Vite server configured by the top-level [`api`](/config/api) option; the default port in browser mode is `23315`. The `browser.api` option is deprecated and no longer has any effect, so move its value to `api`:

```ts [vitest.config.ts]
import { defineConfig } from 'vitest/config'
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ BROWSER_DEV=true pnpm -C packages/ui dev:client

Open the URL printed by the UI dev server, usually `http://localhost:5173/`.

The UI dev server fetches browser runner state from the browser runner server on port `63315` by default. If Vitest prints a different browser runner port, pass it to the UI dev server:
The UI dev server fetches browser runner state from the browser runner server on port `23315` by default. If Vitest prints a different browser runner port, pass it to the UI dev server:

```bash
BROWSER_DEV_PORT=63316 BROWSER_DEV=true pnpm -C packages/ui dev:client
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function devUiScriptPlugin(): Plugin {
const BROWSER_SCRIPT_RE =
/<script type="module">([\s\S]*?window\.__vitest_browser_runner__\s*=\s*\{[\s\S]*?window\.VITEST_API_TOKEN\s*=[\s\S]*?)<\/script>/

const browserUrl = `http://localhost:${process.env.BROWSER_DEV_PORT || '63315'}/__vitest_test__/`
const browserUrl = `http://localhost:${process.env.BROWSER_DEV_PORT || '23315'}/__vitest_test__/`

return {
name: 'dev-ui-script',
Expand Down
2 changes: 1 addition & 1 deletion packages/vitest/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// if changed, update also jsdocs and docs
export const defaultPort = 51204
export const defaultBrowserPort = 63315
export const defaultBrowserPort = 23315
export const defaultInspectPort = 9229

export const API_PATH = '/__vitest_api__'
Expand Down
4 changes: 2 additions & 2 deletions test/browser/specs/browser-multiple.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ it('automatically assigns the port', async () => {

expect(spy).not.toHaveBeenCalled()
expect(stderr).not.toContain('is in use, trying another one...')
expect(urls).toContain('http://localhost:63315/')
expect(urls).toContain('http://localhost:63316/')
expect(urls).toContain('http://localhost:23315/')
expect(urls).toContain('http://localhost:23316/')
})
Loading