Skip to content

Commit 636c2c0

Browse files
committed
Fix tests
1 parent 18adfdd commit 636c2c0

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,8 @@ module.exports = postcss.plugin(
314314
options.mode !== 'local' &&
315315
options.mode !== 'pure'
316316
) {
317-
return result.error(
318-
Error(
319-
'options.mode must be either "global", "local" or "pure" (default "local")'
320-
)
317+
throw Error(
318+
'options.mode must be either "global", "local" or "pure" (default "local")'
321319
)
322320
}
323321
var pureMode = options.mode === 'pure'

test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,11 +441,11 @@ const run = (css, options) =>
441441
tests.forEach(testCase => {
442442
test(testCase.should, () => {
443443
if (testCase.error) {
444-
expect(run(testCase.input, testCase.options)).rejects.toMatch(
444+
return expect(run(testCase.input, testCase.options)).rejects.toMatch(
445445
RegExp(testCase.error)
446446
)
447447
} else {
448-
expect(run(testCase.input, testCase.options)).resolves.toEqual(
448+
return expect(run(testCase.input, testCase.options)).resolves.toEqual(
449449
testCase.expected
450450
)
451451
}

0 commit comments

Comments
 (0)