From 7827444a6663aa5bf87345d344e2ddb70a159dea Mon Sep 17 00:00:00 2001 From: Simon He <57086651+Simon-He95@users.noreply.github.com> Date: Tue, 11 Jun 2024 16:19:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=BC=BA=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/index.test.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/index.test.ts b/test/index.test.ts index 7dccccc..3b3b709 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -710,4 +710,18 @@ describe('aggressiveMode', () => { transform('class="portrait:(tc w20px)"'), ).toMatchInlineSnapshot('"class=\\"portrait:text-center portrait:w-[20px]\\""') }) + it.only('nth', () => { + expect( + transform('class="children:hover:(w20px bg-red-100)"'), + ).toMatchInlineSnapshot('"class=\\"className=\\"children:hover:w20px children:hover:bg-red-100\\"\\""') + expect( + transform('class="first-child:w20px"'), + ).toMatchInlineSnapshot('"class=\\"first:[&>*]:w20px\\""') + expect( + transform('class="last-child:w20px"'), + ).toMatchInlineSnapshot('"class=\\"last:[&>*]:w20px\\""') + expect( + transform('class="child-(3n+1):w20px"'), + ).toMatchInlineSnapshot('"class=\\"[&>*:nth-of-type(3n+1)]:w20px\\""') + }) })