Skip to content

Commit

Permalink
fix(browser): resolve coverage.reporter from string values (#5920)
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio authored Jun 19, 2024
1 parent 2bd8d9d commit f33dabb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/browser/src/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ export default (project: WorkspaceProject, base = '/'): Plugin[] => {
function resolveCoverageFolder(project: WorkspaceProject) {
const options = project.ctx.config
const htmlReporter = options.coverage?.enabled
? options.coverage.reporter.find((reporter) => {
? toArray(options.coverage.reporter).find((reporter) => {
if (typeof reporter === 'string') {
return reporter === 'html'
}
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import sirv from 'sirv'
import type { Plugin } from 'vite'
import { coverageConfigDefaults } from 'vitest/config'
import type { Vitest } from 'vitest'
import { toArray } from '@vitest/utils'

export default (ctx: Vitest): Plugin => {
return <Plugin>{
Expand Down Expand Up @@ -50,7 +51,7 @@ function resolveCoverageFolder(ctx: Vitest) {
const options = ctx.config
const htmlReporter
= options.api?.port && options.coverage?.enabled
? options.coverage.reporter.find((reporter) => {
? toArray(options.coverage.reporter).find((reporter) => {
if (typeof reporter === 'string') {
return reporter === 'html'
}
Expand Down

0 comments on commit f33dabb

Please sign in to comment.