Skip to content

Commit

Permalink
Add an integration test for excluding plugins.
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-eb committed May 29, 2017
1 parent 289637c commit dabd2e6
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/cssnano/src/__tests__/presets.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,28 @@ test('should accept a preset string other than default (sugar syntax)', t => {
});
});

test('should be able to exclude plugins', t => {
const preset = [
'advanced',
{zindex: false},
];

return cssnano.process(`h1{z-index:10}`, {}, {preset}).then(result => {
t.is(result.css, `h1{z-index:10}`);
});
});

test('should be able to exclude plugins (exclude syntax)', t => {
const preset = [
'advanced',
{zindex: {startIndex: 15, exclude: true}},
];

return cssnano.process(`h1{z-index:10}`, {}, {preset}).then(result => {
t.is(result.css, `h1{z-index:10}`);
});
});

test('should error on a bad preset', t => {
t.throws(cssnano.process('h1{}', {}, {preset: 'avanced'}).then(() => {}), Error);
});

0 comments on commit dabd2e6

Please sign in to comment.