Skip to content

Commit f33dabb

Browse files
authored
fix(browser): resolve coverage.reporter from string values (#5920)
1 parent 2bd8d9d commit f33dabb

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/browser/src/node/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ export default (project: WorkspaceProject, base = '/'): Plugin[] => {
358358
function resolveCoverageFolder(project: WorkspaceProject) {
359359
const options = project.ctx.config
360360
const htmlReporter = options.coverage?.enabled
361-
? options.coverage.reporter.find((reporter) => {
361+
? toArray(options.coverage.reporter).find((reporter) => {
362362
if (typeof reporter === 'string') {
363363
return reporter === 'html'
364364
}

packages/ui/node/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import sirv from 'sirv'
44
import type { Plugin } from 'vite'
55
import { coverageConfigDefaults } from 'vitest/config'
66
import type { Vitest } from 'vitest'
7+
import { toArray } from '@vitest/utils'
78

89
export default (ctx: Vitest): Plugin => {
910
return <Plugin>{
@@ -50,7 +51,7 @@ function resolveCoverageFolder(ctx: Vitest) {
5051
const options = ctx.config
5152
const htmlReporter
5253
= options.api?.port && options.coverage?.enabled
53-
? options.coverage.reporter.find((reporter) => {
54+
? toArray(options.coverage.reporter).find((reporter) => {
5455
if (typeof reporter === 'string') {
5556
return reporter === 'html'
5657
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy