@@ -3,7 +3,7 @@ const iconsPlugin = require('../dist/index.js')
3
3
const postcss = require ( 'postcss' )
4
4
const tailwindcss = require ( 'tailwindcss' )
5
5
6
- function run ( config , css = '@tailwind utilities ' , plugin = tailwindcss ) {
6
+ function run ( config , css = '@tailwind components ' , plugin = tailwindcss ) {
7
7
let { currentTestName } = expect . getState ( )
8
8
config = {
9
9
...{
@@ -25,36 +25,25 @@ it('makesIcon', () => {
25
25
content : [ { raw : String . raw `<div class="i-[carbon-add]"></div>` } ] ,
26
26
}
27
27
28
- return run ( config , '@tailwind base; @tailwind utilities' ) . then ( result => {
29
- const h1 = String . raw `--tw-icon`
30
- const width = String . raw `width: 1em; height: 1em`
28
+ return run ( config ) . then ( result => {
29
+ const icon = String . raw `--tw-icon`
30
+ const width = String . raw `width: 1em;
31
+ height: 1em`
31
32
32
- expect ( result . css ) . toContain ( h1 )
33
+ expect ( result . css ) . toContain ( icon )
33
34
expect ( result . css ) . toContain ( width )
34
35
} )
35
36
} )
36
37
37
- it ( 'makesIcon' , ( ) => {
38
- const config = {
39
- content : [ { raw : String . raw `<div class="i-[carbon-add]"></div>` } ] ,
40
- }
41
-
42
- return run ( config , '@tailwind base; @tailwind utilities' ) . then ( result => {
43
- const h1 = String . raw `--tw-icon`
44
-
45
- expect ( result . css ) . toContain ( h1 )
46
- } )
47
- } )
48
-
49
38
it ( 'ignoresBadIcons' , ( ) => {
50
39
const config = {
51
40
content : [ { raw : String . raw `<div class="i-[carbon-ad]"></div>` } ] ,
52
41
}
53
42
54
- return run ( config , '@tailwind base; @tailwind utilities' ) . then ( result => {
55
- const h1 = String . raw `--tw-icon`
43
+ return run ( config ) . then ( result => {
44
+ const icon = String . raw `--tw-icon`
56
45
57
- expect ( result . css ) . toEqual ( expect . not . stringContaining ( h1 ) )
46
+ expect ( result . css ) . toEqual ( expect . not . stringContaining ( icon ) )
58
47
} )
59
48
} )
60
49
@@ -63,11 +52,11 @@ it('makesBgIcon', () => {
63
52
content : [ { raw : String . raw `<div class="i-bg-[carbon-add]"></div>` } ] ,
64
53
}
65
54
66
- return run ( config , '@tailwind base; @tailwind utilities' ) . then ( result => {
67
- const h1 = String . raw `--tw-icon`
55
+ return run ( config ) . then ( result => {
56
+ const icon = String . raw `--tw-icon`
68
57
const bg = String . raw `background: url("data:image/svg+`
69
58
70
- expect ( result . css ) . toEqual ( expect . not . stringContaining ( h1 ) )
59
+ expect ( result . css ) . toEqual ( expect . not . stringContaining ( icon ) )
71
60
expect ( result . css ) . toContain ( bg )
72
61
} )
73
62
} )
@@ -80,8 +69,9 @@ it('usesUnits', () => {
80
69
} ,
81
70
}
82
71
83
- return run ( config , '@tailwind base; @tailwind utilities' ) . then ( result => {
84
- const width = String . raw `width: 1px; height: 1px`
72
+ return run ( config ) . then ( result => {
73
+ const width = String . raw `width: 1px;
74
+ height: 1px`
85
75
expect ( result . css ) . toContain ( width )
86
76
} )
87
77
} )
@@ -94,8 +84,9 @@ it('usesScale', () => {
94
84
} ,
95
85
}
96
86
97
- return run ( config , '@tailwind base; @tailwind utilities' ) . then ( result => {
98
- const width = String . raw `width: 1.2em; height: 1.2em`
87
+ return run ( config ) . then ( result => {
88
+ const width = String . raw `width: 1.2em;
89
+ height: 1.2em`
99
90
expect ( result . css ) . toContain ( width )
100
91
} )
101
92
} )
@@ -109,8 +100,9 @@ it('usesScaleAndUnits', () => {
109
100
} ,
110
101
}
111
102
112
- return run ( config , '@tailwind base; @tailwind utilities' ) . then ( result => {
113
- const width = String . raw `width: 20px; height: 20px`
103
+ return run ( config ) . then ( result => {
104
+ const width = String . raw `width: 20px;
105
+ height: 20px`
114
106
expect ( result . css ) . toContain ( width )
115
107
} )
116
108
} )
0 commit comments