From a0d0d96ac6400a1b2b9040df145114a44afc6fbe Mon Sep 17 00:00:00 2001 From: Adam Wathan <4323180+adamwathan@users.noreply.github.com> Date: Thu, 17 Nov 2022 15:20:48 -0500 Subject: [PATCH] Add additional matchUtilities test --- tests/match-utilities.test.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/match-utilities.test.js b/tests/match-utilities.test.js index 0ba83a0fc..b6add847d 100644 --- a/tests/match-utilities.test.js +++ b/tests/match-utilities.test.js @@ -166,6 +166,36 @@ test('match utilities can omit utilities by returning null', async () => { `) }) +test('matching utilities with a basic configured value', () => { + let config = { + content: [{ raw: html`
` }], + theme: {}, + plugins: [ + function ({ matchUtilities }) { + matchUtilities( + { + test: (value) => ({ value }), + }, + { + values: { + foo: 'value_foo', + }, + } + ) + }, + ], + corePlugins: [], + } + + return run('@tailwind utilities', config).then((result) => { + expect(result.css).toMatchCss(css` + .test-foo { + value: value_foo; + } + `) + }) +}) + test('matching utilities with an arbitrary value and configured modifier', () => { let config = { content: [{ raw: html`
` }],