* only try to pretty print `err.source` if it exists
* fix small typo
* drop unnecessary path resolving
* add `from` and `to` to `run` test helper
* enable all source map tests
* ensure source maps are generated properly
* update annotation values in tests
* handle `map: true`
* add test for `map: { inline: true }`
* force Lightning CSS to handle an inline source map
* base64 encode the test name
This will get rid of special characters that can cause issues /
confusion when debugging tests.
* ensure utilities and components with variants are pointing to the correct source
Co-authored-by: Jordan Pittman <jordan@cryptica.me>
* update changelog
---------
Co-authored-by: Jordan Pittman <jordan@cryptica.me>
39 lines
869 B
JavaScript
39 lines
869 B
JavaScript
import postcss from 'postcss'
|
|
import tailwind from '../../src'
|
|
|
|
export * from './strings'
|
|
export * from './defaults'
|
|
|
|
export let map = JSON.stringify({
|
|
version: 3,
|
|
file: null,
|
|
sources: [],
|
|
names: [],
|
|
mappings: '',
|
|
})
|
|
|
|
export function run(input, config, plugin = tailwind) {
|
|
let { currentTestName, testPath } = expect.getState()
|
|
let path = `${testPath}?test=${Buffer.from(currentTestName).toString('base64')}`
|
|
|
|
return postcss(plugin(config)).process(input, {
|
|
from: path,
|
|
to: path,
|
|
})
|
|
}
|
|
|
|
export function runWithSourceMaps(
|
|
input,
|
|
config,
|
|
options = { map: { prev: map } },
|
|
plugin = tailwind
|
|
) {
|
|
let { currentTestName, testPath } = expect.getState()
|
|
let path = `${testPath}?test=${Buffer.from(currentTestName).toString('base64')}`
|
|
|
|
return postcss(plugin(config)).process(input, {
|
|
from: path,
|
|
to: path,
|
|
...options,
|
|
})
|
|
}
|