-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.test.js
43 lines (35 loc) · 1.13 KB
/
index.test.js
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
34
35
36
37
38
39
40
41
42
const postcss = require('postcss');
const plugin = require('./');
function run(input, output, opts) {
opts = opts || {};
return postcss([plugin(opts)]).process(input)
.then(result => {
expect(result.css).toEqual(output);
expect(result.warnings().length).toBe(0);
});
}
it('Should work correct with combined entity', () => {
return run('a:before{content: "×trimer;"}',
'a:before{content: "\\d7trimer;"}',
{});
});
it('Should work correct with wrong entities', () => {
return run('a:before{content: "&trimer;"}',
'a:before{content: "&trimer;"}',
{});
});
it('Should not make any changes if content have no entities', () => {
return run('a:before{content: "Email: "}',
'a:before{content: "Email: "}',
{});
});
it('Should work correct with alone entity', () => {
return run('a:before{content: "×"}',
'a:before{content: "\\d7"}',
{});
});
it('Should work correct with multi entities', () => {
return run('a:before{content: "✓ - ×"}',
'a:before{content: "\\2713 - \\d7"}',
{});
});