Skip to content

Commit

Permalink
Refactor fixture tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-eb committed Oct 23, 2016
1 parent 34ca2f3 commit 2ad9e47
Show file tree
Hide file tree
Showing 58 changed files with 389 additions and 257 deletions.
3 changes: 0 additions & 3 deletions .editorconfig
Expand Up @@ -9,9 +9,6 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[tests/**/**.{disabled,expected}.css]
insert_final_newline = false

[*.{json,yml}]
indent_size = 2

Expand Down
8 changes: 5 additions & 3 deletions src/__tests__/api.js
@@ -1,4 +1,3 @@
import {readFileSync as read} from 'fs';
import postcss from 'postcss';
import ava from 'ava';
import nano from '..';
Expand All @@ -20,8 +19,11 @@ ava('can be used as a postcss plugin (2)', pluginMacro, postcss([nano()]));
ava('can be used as a postcss plugin (3)', pluginMacro, postcss(nano));

ava('can be used as a postcss plugin, with options', t => {
const css = read(__dirname + '/fixtures/reduceCalc.fixture.css', 'utf-8');
const exp = read(__dirname + '/fixtures/reduceCalc.disabled.css', 'utf-8');
const css = `
h1 {
width: calc(3px * 2 - 1px);
}`;
const exp = `h1{width:calc(3px * 2 - 1px)}`;

return postcss(nano({calc: false})).process(css).then(result => {
t.deepEqual(result.css, exp, specName('notTransformCalcProperty'));
Expand Down

0 comments on commit 2ad9e47

Please sign in to comment.