forked from tailwindlabs/tailwindcss
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimport-syntax.test.js
More file actions
33 lines (28 loc) · 787 Bytes
/
import-syntax.test.js
File metadata and controls
33 lines (28 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import fs from 'fs'
import path from 'path'
import { run, css } from './util/run'
test('using @import instead of @tailwind', () => {
let config = {
content: [path.resolve(__dirname, './import-syntax.test.html')],
corePlugins: { preflight: false },
plugins: [
function ({ addBase }) {
addBase({
h1: {
fontSize: '32px',
},
})
},
],
}
let input = css`
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';
`
return run(input, config).then((result) => {
let expectedPath = path.resolve(__dirname, './import-syntax.test.css')
let expected = fs.readFileSync(expectedPath, 'utf8')
expect(result.css).toMatchFormattedCss(expected)
})
})