tailwindcss/tests/corePlugins.test.js
Robin Malfait 468c9c5e4b
EnsurecorePlugins order is consistent (#5928)
* ensure corePlugins order is consistent

* update order in tests
2021-10-29 13:36:16 +02:00

32 lines
874 B
JavaScript

import postcss from 'postcss'
import tailwind from '../src/index'
function run(input, config = {}) {
return postcss([tailwind(config)]).process(input, { from: undefined })
}
it('should not change the order of the plugins based on corePlugins in config', async () => {
let config1 = {
purge: {
enabled: true,
content: [{ raw: `<div class="transform translate-x-full"></div>` }],
},
corePlugins: ['translate', 'transform'],
}
let config2 = {
purge: {
enabled: true,
content: [{ raw: `<div class="transform translate-x-full"></div>` }],
},
corePlugins: ['transform', 'translate'],
}
let input = `
@tailwind base;
@tailwind components;
@tailwind utilities;
`
let [first, second] = await Promise.all([run(input, config1), run(input, config2)])
expect(first.css).toMatchFormattedCss(second.css)
})