forked from unocss/unocss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
blocklist.test.ts
31 lines (29 loc) · 939 Bytes
/
blocklist.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { createGenerator } from '@unocss/core'
import presetUno from '@unocss/preset-uno'
import { describe, expect, test } from 'vitest'
describe('blocklist', () => {
test('basic', async () => {
const uno = createGenerator({
presets: [
presetUno(),
],
})
const dos = createGenerator({
warn: false,
blocklist: [
'block',
/^text-/,
],
presets: [
presetUno(),
],
})
const { css: css1 } = await uno.generate('block text-red-200 hover:block', { minify: true, preflights: false })
const { css: css2 } = await dos.generate('block text-red-200 hover:block', { minify: true, preflights: false })
expect(css1).contain('.block')
expect(css1).contain('.text-red-200')
expect(css2).eq('')
const { css: css3 } = await dos.generate('block text-red-200 hover:block', { minify: true, preflights: false })
expect(css3).eq('')
})
})