Skip to content

Commit e4a5e48

Browse files
Add test for prefix()
1 parent 2e85672 commit e4a5e48

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

packages/tailwindcss/src/plugin-api.test.ts

+20
Original file line numberDiff line numberDiff line change
@@ -1800,3 +1800,23 @@ describe('addComponents()', () => {
18001800
`)
18011801
})
18021802
})
1803+
1804+
describe('prefix()', () => {
1805+
test('is an identity function', async () => {
1806+
let fn = vi.fn()
1807+
await compile(
1808+
css`
1809+
@plugin "my-plugin";
1810+
`,
1811+
{
1812+
async loadPlugin() {
1813+
return ({ prefix }: PluginAPI) => {
1814+
fn(prefix('btn'))
1815+
}
1816+
},
1817+
},
1818+
)
1819+
1820+
expect(fn).toHaveBeenCalledWith('btn')
1821+
})
1822+
})

0 commit comments

Comments
 (0)