8000 Add additional matchUtilities test · siberfx/tailwindcss@a0d0d96 · GitHub
Skip to content

Commit a0d0d96

Browse files
committed
Add additional matchUtilities test
1 parent cdbaa74 commit a0d0d96

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/match-utilities.test.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,36 @@ test('match utilities can omit utilities by returning null', async () => {
166166
`)
167167
})
168168

169+
test('matching utilities with a basic configured value', () => {
170+
let config = {
171+
content: [{ raw: html`<div class="test-foo"></div>` }],
172+
theme: {},
173+
plugins: [
174+
function ({ matchUtilities }) {
175+
matchUtilities(
176+
{
177+
test: (value) => ({ value }),
178+
},
179+
{
180+
values: {
181+
foo: 'value_foo',
182+
},
183+
}
184+
)
185+
},
186+
],
187+
corePlugins: [],
188+
}
189+
190+
return run('@tailwind utilities', config).then((result) => {
191+
expect(result.css).toMatchCss(css`
192+
.test-foo {
193+
value: value_foo;
194+
}
195+
`)
196+
})
197+
})
198+
169199
test('matching utilities with an arbitrary value and configured modifier', () => {
170200
let config = {
171201
content: [{ raw: html`<div class="test-[foo]/bar"></div>` }],

0 commit comments

Comments
 (0)