-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.test.js
36 lines (33 loc) · 924 Bytes
/
index.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* eslint-env jest */
const postcss = require('postcss')
const plugin = require('./')
function run (input, output, opts) {
const result = postcss([plugin(opts)]).process(input, { from: undefined })
expect(result.css).toEqual(output)
expect(result.warnings()).toHaveLength(0)
}
it('removes declarations', () => {
run(
`a {
stroke: 1px solid;
flex: 1 0 auto;
color: black;
}`,
`a {
stroke: 1px solid;
color: black;
}`,
{
allowedPropNames: [
'stroke', 'stroke-width', 'stroke-opacity', 'stroke-dasharray',
'stroke-dashoffset', 'stroke-linecap',
'stroke-linejoin', 'stroke-miterlimit',
'fill', 'fill-rule', 'fill-opacity',
'clip-path', 'mask',
'opacity', 'color', 'stop-color', 'stop-opacity',
'font-family', 'font-size', 'font-weight',
'text-anchor', 'visibility', 'display'
]
}
)
})