Skip to content

Commit

Permalink
chore(test): add test for plugin options
Browse files Browse the repository at this point in the history
  • Loading branch information
ThornWalli committed Jun 29, 2022
1 parent ff1cf64 commit 4f9ae06
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions test/lost-plugin-options.js
@@ -0,0 +1,44 @@
'use strict';

const postcss = require('postcss');
const lost = require('../lost');
const expect = require('chai').expect;

describe('plugin-options', () => {
it('set options with plugin options', async () => {
const input = `
div {
lost-column: 1/2;
}
`;
const output = `
div {
flex-grow: 0;
flex-shrink: 0;
flex-basis: calc(99.9% * 1/2 - (15px - 15px * 1/2));
max-width: calc(99.9% * 1/2 - (15px - 15px * 1/2));
width: calc(99.9% * 1/2 - (15px - 15px * 1/2));
}
div:nth-child(1n) {
margin-right: 15px;
margin-left: 0;
}
div:last-child {
margin-right: 0;
}
div:nth-child(2n) {
margin-right: 0;
margin-left: auto;
}
`;
const result = await postcss([
lost({
gutter: '15px',
flexbox: 'flex',
cycle: 'auto'
})
])
.process(input);
expect(output).to.equal(result.css);
});
});

0 comments on commit 4f9ae06

Please sign in to comment.