-
Notifications
You must be signed in to change notification settings - Fork 5
/
test.js
36 lines (32 loc) · 925 Bytes
/
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
const cssMatcher = require('jest-matcher-css')
const plugin = require('./index')
const { run } = require('../../testing/run')
expect.extend({
toMatchCss: cssMatcher,
})
it('should generate the parent-open classes', () => {
const config = {
content: [
{
raw: String.raw`
<details open>
<summary>
<span class="parent-open:rotate-180">></span>
</summary>
</details>
`,
},
],
}
const output = String.raw`
[open] .parent-open\:rotate-180 {
--tw-rotate: 180deg;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))
}
`
expect.assertions(2)
return run(plugin, config).then((result) => {
expect(result.warnings().length).toBe(0)
expect(result.css).toMatchCss(output)
})
})