Robin Malfait e37931ba65
JIT by default - move tests and make them consistent (#5374)
* move `./tests/jit` to `./tests`

* make tests consistent

Abstracted a `run` function and some syntax highlighting helpers for
`html`, `css` and `javascript`.
2021-09-03 13:48:16 +02:00

20 lines
454 B
JavaScript

import path from 'path'
import postcss from 'postcss'
import tailwind from '../../src'
export function run(input, config, plugin = tailwind) {
let { currentTestName } = expect.getState()
return postcss(plugin(config)).process(input, {
from: `${path.resolve(__filename)}?test=${currentTestName}`,
})
}
function syntax(templates) {
return templates.join('')
}
export let css = syntax
export let html = syntax
export let javascript = syntax