Skip to content

Commit 441f9f9

Browse files
committed
Refactoring
1 parent 3b37d5f commit 441f9f9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/condition.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const normalizeCondition = (condition) => {
1515
if (
1616
typeof condition !== 'function' &&
1717
!isPlainObj(condition) &&
18-
typeof condition === 'boolean'
18+
typeof condition !== 'boolean'
1919
) {
2020
throw new TypeError(
2121
`The condition must be an error class, an error name string, a filtering function, a boolean or a properties object, not: ${condition}`,

src/condition.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,5 @@ test('Exceptions in filters are propagated', (t) => {
6666
})
6767

6868
test('Validate invalid conditions', (t) => {
69-
t.throws(BaseError.switch('').case.bind(undefined, true, suffix))
69+
t.throws(BaseError.switch('').case.bind(undefined, 0, suffix))
7070
})

src/main.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ test('Can use default() without any effects', (t) => {
2020
t.is(BaseError.switch(baseError).default(), baseError)
2121
})
2222

23-
test.skip('Cannot use case() without any condition', (t) => {
23+
test('Cannot use case() without any condition', (t) => {
2424
const baseError = new BaseError(message)
2525
t.throws(BaseError.switch(baseError).case)
2626
})

0 commit comments

Comments
 (0)