-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.test.js
35 lines (29 loc) · 956 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
let { equal } = require('uvu/assert')
let { test } = require('uvu')
let postcss = require('postcss')
let plugin = require('./')
async function run(input, output) {
let result = await postcss([plugin]).process(input, { from: undefined })
equal(result.css, output)
equal(result.warnings().length, 0)
}
test('adds 3D hacks', async () => {
await run(
'a{ will-change: transform; }',
'a{ backface-visibility: hidden; will-change: transform; }'
)
})
test('does not override existing properties', async () => {
await run(
'a{ backface-visibility: visible; will-change: transform; }',
'a{ backface-visibility: visible; will-change: transform; }'
)
})
test('does not get confused by other selectors', async () => {
await run(
'a{ backface-visibility: visible; } b { will-change: transform; }',
'a{ backface-visibility: visible; } ' +
'b { backface-visibility: hidden; will-change: transform; }'
)
})
test.run()