mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
19 lines
491 B
JavaScript
19 lines
491 B
JavaScript
import postcss from 'postcss'
|
|
import applyClassPrefix from '../src/util/applyClassPrefix'
|
|
|
|
test('it prefixes classes with the provided prefix', () => {
|
|
const input = postcss.parse(`
|
|
.foo { color: red; }
|
|
.apple, .pear { color: green; }
|
|
`)
|
|
|
|
const expected = `
|
|
.tw-foo { color: red; }
|
|
.tw-apple, .tw-pear { color: green; }
|
|
`
|
|
|
|
const result = applyClassPrefix(input, 'tw-').toResult()
|
|
expect(result.css).toEqual(expected)
|
|
expect(result.warnings().length).toBe(0)
|
|
})
|