-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.js
50 lines (44 loc) · 1.03 KB
/
tests.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
43
44
45
46
47
48
49
50
/* global describe, it */
const assert = require('assert');
const inlinestyles = require('.');
describe('inlinestyles', () => {
it('keeps string or number object values', () => {
assert.equal(inlinestyles({
background: 'black',
color: 'gold',
margin: 0,
padding: undefined
}), 'background:black;color:gold;margin:0;');
});
it('should be trimmed', () => {
assert.equal(inlinestyles({background: 'black'}, 'color:gold', 0, undefined, false, null), 'background:black;');
});
it('returns an empty string for an empty configuration', () => {
assert.equal(inlinestyles({}), '');
});
it('handles list of object arguments', () => {
assert.equal(inlinestyles(
{
background: 'black',
color: 'gold'
},
{
background: 'gold',
color: 'black'
}
), 'background:gold;color:black;');
});
it('handles duplicate object property names', () => {
assert.equal(inlinestyles(
{
background: 'black'
},
{
background: 'gold'
},
{
background: false
}
), 'background:gold;');
});
});