diff --git a/packages/browser/src/node/plugin.ts b/packages/browser/src/node/plugin.ts index 7a7d5f37767c..524fb9bf3307 100644 --- a/packages/browser/src/node/plugin.ts +++ b/packages/browser/src/node/plugin.ts @@ -232,6 +232,7 @@ export default (browserServer: BrowserServer, base = '/'): Plugin[] => { } const include = [ + 'vitest > expect-type', 'vitest > @vitest/snapshot > magic-string', 'vitest > chai', 'vitest > chai > loupe', diff --git a/test/browser/specs/runner.test.ts b/test/browser/specs/runner.test.ts index 290cf3424e0f..419aa61df9c4 100644 --- a/test/browser/specs/runner.test.ts +++ b/test/browser/specs/runner.test.ts @@ -1,6 +1,7 @@ import { readFile } from 'node:fs/promises' import { beforeAll, describe, expect, onTestFailed, test } from 'vitest' -import { browser, runBrowserTests } from './utils' +import { defaultBrowserPort } from 'vitest/config' +import { browser, provider, runBrowserTests } from './utils' describe('running browser tests', async () => { let stderr: string @@ -28,10 +29,13 @@ describe('running browser tests', async () => { console.error(stderr) }) + expect(stdout).toContain(`Browser runner started by ${provider} at http://localhost:${defaultBrowserPort}/`) + expect(browserResultJson.testResults).toHaveLength(19) expect(passedTests).toHaveLength(17) expect(failedTests).toHaveLength(2) + expect(stderr).not.toContain('optimized dependencies changed') expect(stderr).not.toContain('has been externalized for browser compatibility') expect(stderr).not.toContain('Unhandled Error') }) diff --git a/test/cli/test/server-url.test.ts b/test/cli/test/server-url.test.ts index db63237b2a28..df6a1eae1f61 100644 --- a/test/cli/test/server-url.test.ts +++ b/test/cli/test/server-url.test.ts @@ -4,14 +4,16 @@ import { runVitest } from '../../test-utils' it('api server-url http', async () => { delete process.env.TEST_HTTPS - const { stdout } = await runVitest({ root: './fixtures/ws-server-url', api: true }) + const { stdout, stderr } = await runVitest({ root: './fixtures/ws-server-url', api: true }) + expect(stderr).toBe('') expect(stdout).toContain('API started at http://localhost:51204/') expect(stdout).toContain('Test Files 1 passed') }) it('api server-url https', async () => { process.env.TEST_HTTPS = '1' - const { stdout } = await runVitest({ root: './fixtures/ws-server-url', api: true }) + const { stdout, stderr } = await runVitest({ root: './fixtures/ws-server-url', api: true }) + expect(stderr).toBe('') expect(stdout).toContain('API started at https://localhost:51204/') expect(stdout).toContain('Test Files 1 passed') })