/
githubmirror
/
tailwindcss
Обзор
Документация
Войти
/
githubmirror
/
tailwindcss
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v3.4.19
tests/custom-transformers.test.js
67 строк
1 KB
Robin Malfait
Cleanup oxide — Part #2 (#13312)
22 мар 2024, 19:12
Не верифицирован
22 мар 2024, 19:12
44b3b42
Код
Авторство
О чём код?
import { run, html, css } from './util/run' function customTransformer(content) { return content.replace(/uppercase/g, 'lowercase') } test('transform function', () => { let config = { content: { files: [{ raw: html`<div class="uppercase"></div>` }], transform: customTransformer, }, } return run('@tailwind utilities', config).then((result) => { expect(result.css).toMatchFormattedCss(css` .lowercase { text-transform: lowercase; } `) }) }) test('transform.DEFAULT', () => { let config = { content: { files: [{ raw: html`<div class="uppercase"></div>` }], transform: { DEFAULT: customTransformer, }, }, } return run('@tailwind utilities', config).then((result) => { expect(result.css).toMatchFormattedCss(css` .lowercase { text-transform: lowercase; } `) }) }) test('transform.{extension}', () => { let config = { content: { files: [ { raw: 'blah blah blah', extension: 'html' }, { raw: 'blah blah blah', extension: 'php' }, ], transform: { html: () => 'uppercase', php: () => 'lowercase', }, }, } return run('@tailwind utilities', config).then((result) => { expect(result.css).toMatchFormattedCss(css` .uppercase { text-transform: uppercase; } .lowercase { text-transform: lowercase; } `) }) })