Skip to content

Commit 767e35a

Browse files
committed
test: test tailwind full reload
1 parent a3bb67b commit 767e35a

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

packages/plugin-rsc/e2e/basic.test.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,14 +1237,32 @@ function defineTest(f: Fixture) {
12371237
logs.push(msg.text())
12381238
}
12391239
})
1240-
f.createEditor('src/routes/tailwind/unused.tsx').resave()
1241-
await page.waitForTimeout(200)
12421240
f.createEditor('src/routes/tailwind/server.tsx').resave()
1241+
await expect
1242+
.poll(() => logs)
1243+
.toEqual([
1244+
expect.stringMatching(/\[vite-rsc:update\].*\/tailwind\/server.tsx/),
1245+
])
12431246
await page.waitForTimeout(200)
12441247
expect(logs).toEqual([
12451248
expect.stringMatching(/\[vite-rsc:update\].*\/tailwind\/server.tsx/),
12461249
])
12471250
})
1251+
1252+
// https://github.com/tailwindlabs/tailwindcss/pull/19745
1253+
test('tailwind force reloads on file changes outside of module graph', async ({
1254+
page,
1255+
}) => {
1256+
await page.goto(f.url())
1257+
await waitForHydration(page)
1258+
const reloaded = page.waitForEvent('framenavigated', {
1259+
predicate: (frame) =>
1260+
frame === page.mainFrame() && frame.url().startsWith(f.url()),
1261+
})
1262+
f.createEditor('src/routes/tailwind/unused.tsx').resave()
1263+
await reloaded
1264+
await waitForHydration(page)
1265+
})
12481266
})
12491267

12501268
test('temporary references @js', async ({ page }) => {

0 commit comments

Comments
 (0)