- Setup the codebase to be able to use the Rust parts based on an environment variable: `OXIDE=1`. - Setup some tests that run both the non-Rust and Rust version in the same test. - Sort the candidates in a consistent way, to guarantee the order for now (especially in tests). - Reflect sorting related changes in tests. - Ensure tests run in both the Rust and non-Rust version. (Some tests are explicitly skipped when using the Rust version since we haven't implemented those features yet. These include: custom prefix, transformers and extractors). - `jest` -`OXIDE=1 jest`
23 lines
586 B
JavaScript
23 lines
586 B
JavaScript
import fs from 'fs'
|
|
import path from 'path'
|
|
|
|
import { run, css } from './util/run'
|
|
|
|
it('raw content', () => {
|
|
let config = {
|
|
content: [{ raw: fs.readFileSync(path.resolve(__dirname, './raw-content.test.html'), 'utf8') }],
|
|
corePlugins: { preflight: false },
|
|
}
|
|
|
|
let input = css`
|
|
@tailwind components;
|
|
@tailwind utilities;
|
|
`
|
|
|
|
return run(input, config).then((result) => {
|
|
let expectedPath = path.resolve(__dirname, './raw-content.test.css')
|
|
let expected = fs.readFileSync(expectedPath, 'utf8')
|
|
|
|
expect(result.css).toMatchFormattedCss(expected)
|
|
})
|
|
})
|