Skip to content

Commit

Permalink
fix: check both "local" and "network"
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Jan 16, 2024
1 parent b2c79e4 commit ba594a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/vitest/src/node/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ export class Logger {
const name = project.getName()
const output = project.isCore() ? '' : ` [${name}]`

const url = new URL('/', project.browser.resolvedUrls?.local[0])
this.log(c.dim(c.green(` ${output} Browser runner started at ${url}`)))
const resolvedUrls = project.browser.resolvedUrls
const origin = resolvedUrls?.local[0] ?? resolvedUrls?.network[0]
this.log(c.dim(c.green(` ${output} Browser runner started at ${new URL('/', origin)}`)))
})

if (this.ctx.config.ui)
Expand Down
3 changes: 2 additions & 1 deletion packages/vitest/src/node/pools/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export function createBrowserPool(ctx: Vitest): ProcessPool {
const provider = project.browserProvider!
providers.add(provider)

const origin = project.browser?.resolvedUrls?.local[0]
const resolvedUrls = project.browser?.resolvedUrls
const origin = resolvedUrls?.local[0] ?? resolvedUrls?.network[0]
const paths = files.map(file => relative(project.config.root, file))

if (project.config.browser.isolate) {
Expand Down

0 comments on commit ba594a4

Please sign in to comment.