diff --git a/__tests__/applyAtRule.test.js b/__tests__/applyAtRule.test.js index 652b44940..1829a3f9d 100644 --- a/__tests__/applyAtRule.test.js +++ b/__tests__/applyAtRule.test.js @@ -1,14 +1,14 @@ import postcss from 'postcss' import plugin from '../src/lib/substituteClassApplyAtRules' -function run(input, opts) { +function run(input, opts = () => {}) { return postcss([plugin(opts)]).process(input) } test("it copies a class's declarations into itself", () => { const output = '.a { color: red; } .b { color: red; }' - return run('.a { color: red; } .b { @apply .a; }', {}).then(result => { + return run('.a { color: red; } .b { @apply .a; }').then(result => { expect(result.css).toEqual(output) expect(result.warnings().length).toBe(0) }) @@ -38,16 +38,15 @@ test("it doesn't copy a media query definition into itself", () => { .b { @apply .a; - }`, - {} - ).then(result => { + }`) + .then(result => { expect(result.css).toEqual(output) expect(result.warnings().length).toBe(0) }) }) test('it fails if the class does not exist', () => { - run('.b { @apply .a; }', {}).catch(error => { + run('.b { @apply .a; }').catch(error => { expect(error.reason).toEqual('No .a class found.') }) }) diff --git a/__tests__/focusableAtRule.test.js b/__tests__/focusableAtRule.test.js index 51cdda213..04fb8ba64 100644 --- a/__tests__/focusableAtRule.test.js +++ b/__tests__/focusableAtRule.test.js @@ -1,7 +1,7 @@ import postcss from 'postcss' import plugin from '../src/lib/substituteFocusableAtRules' -function run(input, opts = {}) { +function run(input, opts = () => {}) { return postcss([plugin(opts)]).process(input) } @@ -18,7 +18,7 @@ test("it adds a focusable variant to each nested class definition", () => { .chocolate, .focus\\:chocolate:focus { color: brown; } ` - return run(input, {}).then(result => { + return run(input).then(result => { expect(result.css).toEqual(output) expect(result.warnings().length).toBe(0) }) diff --git a/__tests__/hoverableAtRule.test.js b/__tests__/hoverableAtRule.test.js index cd6747bd8..afcd5096f 100644 --- a/__tests__/hoverableAtRule.test.js +++ b/__tests__/hoverableAtRule.test.js @@ -1,7 +1,7 @@ import postcss from 'postcss' import plugin from '../src/lib/substituteHoverableAtRules' -function run(input, opts = {}) { +function run(input, opts = () => {}) { return postcss([plugin(opts)]).process(input) } @@ -18,7 +18,7 @@ test("it adds a hoverable variant to each nested class definition", () => { .chocolate, .hover\\:chocolate:hover { color: brown; } ` - return run(input, {}).then(result => { + return run(input).then(result => { expect(result.css).toEqual(output) expect(result.warnings().length).toBe(0) })