Skip to content

Commit

Permalink
fix(browser): optimize expect-type (#6713)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va authored Oct 15, 2024
1 parent e5c388f commit 0791853
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/browser/src/node/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 5 additions & 1 deletion test/browser/specs/runner.test.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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')
})
Expand Down
6 changes: 4 additions & 2 deletions test/cli/test/server-url.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
Expand Down

0 comments on commit 0791853

Please sign in to comment.