-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
43 lines (38 loc) · 966 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
37
38
39
40
41
42
43
const cssMatcher = require('jest-matcher-css')
const plugin = require('./index')
const { generateUtilities } = require('tailwindcss-plugin-test-helpers')
expect.extend({
toMatchCss: cssMatcher,
})
test('it generates the list reset class', () => {
const output = `
.list-reset {
list-style: none;
padding: 0
}
`
generateUtilities(plugin).then(result => {
expect(result.css).toMatchCss(output)
expect(result.warnings().length).toBe(0)
})
})
test('it generates the list reset class with variants', () => {
const output = `
.list-reset {
list-style: none;
padding: 0
}
.hover\\:list-reset:hover {
list-style: none;
padding: 0
}
.focus\\:list-reset:focus {
list-style: none;
padding: 0
}
`
generateUtilities(plugin, { variants: ['hover', 'focus'] }).then(result => {
expect(result.css).toMatchCss(output)
expect(result.warnings().length).toBe(0)
})
})