forked from tailwindlabs/tailwindcss
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcustom-separator.test.js
More file actions
31 lines (25 loc) · 886 Bytes
/
Copy pathcustom-separator.test.js
File metadata and controls
31 lines (25 loc) · 886 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
import fs from 'fs'
import path from 'path'
import { run } from './util/run'
test('custom separator', () => {
let config = {
darkMode: 'class',
content: [path.resolve(__dirname, './custom-separator.test.html')],
separator: '_',
}
return run('@tailwind utilities', config).then((result) => {
let expectedPath = path.resolve(__dirname, './custom-separator.test.css')
let expected = fs.readFileSync(expectedPath, 'utf8')
expect(result.css).toMatchFormattedCss(expected)
})
})
test('dash is not supported', () => {
let config = {
darkMode: 'class',
content: [{ raw: 'lg-hover-font-bold' }],
separator: '-',
}
return expect(run('@tailwind utilities', config)).rejects.toThrowError(
"The '-' character cannot be used as a custom separator in JIT mode due to parsing ambiguity. Please use another character like '_' instead."
)
})