We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4e9349 commit 5b9aa8aCopy full SHA for 5b9aa8a
src/__tests__/integration.js
@@ -0,0 +1,30 @@
1
+import test from 'ava';
2
+import postcss from 'postcss';
3
+
4
+import reduceCalc from '../../dist';
5
6
+const testPlugin = {
7
+ postcssPlugin: 'testplugin',
8
+ Declaration(decl) {
9
+ if (decl.value.startsWith('calc')) {
10
+ decl.value = 'calc(50%-0.5rem)'
11
+ }
12
13
+}
14
15
+const processor = postcss([reduceCalc, testPlugin]);
16
17
+const css = `.item {
18
+ align-self: flex-end;
19
+ flex-basis: calc((100% - 1rem) / 2);
20
+}`;
21
22
+test('handles a different plugin changing the same declaration', t => {
23
+ t.plan(1);
24
+ return processor.process(css, {from: undefined}).then(result => {
25
+ t.deepEqual(result.css, `.item {
26
27
+ flex-basis: calc(50% - 0.5rem);
28
+}`);
29
+ });
30
+})
0 commit comments