Skip to content

Commit 403414c

Browse files
committed
Fix tests
1 parent d573eb2 commit 403414c

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/options/classes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const applyClassesOpts = ({ name }, opts = {}) => {
1818
return { ...optsA, ...removeUndefined(classesOpts) }
1919
}
2020

21-
const validateObject = (value, optName) => {
21+
export const validateObject = (value, optName) => {
2222
if (!isPlainObj(value)) {
2323
throw new Error(`"${optName}" must be a plain object: ${value}`)
2424
}

src/options/validate.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ import isPlainObj from 'is-plain-obj'
44
import { validateExitCode } from '../exit.js'
55
import { validateTimeout } from '../timeout.js'
66

7-
import { applyClassesOpts } from './classes.js'
7+
import { applyClassesOpts, validateObject } from './classes.js'
88

99
// Validate option values.
1010
// This is exported, although not documented.
11-
export const validateOptions = (opts) => {
12-
if (!isPlainObj(opts)) {
13-
return
14-
}
11+
export const validateOptions = (opts = {}) => {
12+
validateObject(opts, 'options')
1513

1614
const { classes } = opts
1715
const names =

0 commit comments

Comments
 (0)