mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
33 lines
768 B
JavaScript
33 lines
768 B
JavaScript
import postcss from 'postcss'
|
|
import fs from 'fs'
|
|
import path from 'path'
|
|
import tailwind from '../../src/jit/index.js'
|
|
|
|
function run(input, config = {}) {
|
|
return postcss(tailwind(config)).process(input, {
|
|
from: path.resolve(__filename),
|
|
})
|
|
}
|
|
|
|
test('basic usage', () => {
|
|
let config = {
|
|
purge: [path.resolve(__dirname, './svelte-syntax.test.svelte')],
|
|
mode: 'jit',
|
|
corePlugins: { preflight: false },
|
|
theme: {},
|
|
plugins: [],
|
|
}
|
|
|
|
let css = `
|
|
@tailwind components;
|
|
@tailwind utilities;
|
|
`
|
|
|
|
return run(css, config).then((result) => {
|
|
let expectedPath = path.resolve(__dirname, './svelte-syntax.test.css')
|
|
let expected = fs.readFileSync(expectedPath, 'utf8')
|
|
|
|
expect(result.css).toMatchFormattedCss(expected)
|
|
})
|
|
})
|