-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathindex.test.js
77 lines (69 loc) · 1.69 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
const stylelint = require('stylelint')
describe('stylelint-config-styled-components', () => {
it('does not allow vendor prefixes in values', () => {
const css = 'a { display: -webkit-flex; }'
expect.assertions(2)
return stylelint
.lint({
code: css,
formatter: 'string',
config: {
extends: './index'
}
})
.then(result => {
expect(result.errored).toBe(true)
expect(result.output.includes('value-no-vendor-prefix')).toBe(true)
})
})
it('does not allow vendor prefixes in properties', () => {
const css = 'a { -webkit-transform: scale(1); }'
expect.assertions(2)
return stylelint
.lint({
code: css,
formatter: 'string',
config: {
extends: './index'
}
})
.then(result => {
expect(result.errored).toBe(true)
expect(result.output.includes('property-no-vendor-prefix')).toBe(true)
})
})
it('disables no-empty-source', () => {
const css = ''
expect.assertions(1)
return stylelint
.lint({
code: css,
config: {
extends: [
'stylelint-config-standard',
'./index'
]
}
})
.then(result => {
expect(result.errored).toBe(false)
})
})
it('disables no-missing-end-of-source-newline', () => {
const css = 'a { color: pink; }'
expect.assertions(1)
return stylelint
.lint({
code: css,
config: {
extends: [
'stylelint-config-standard',
'./index'
]
}
})
.then(result => {
expect(result.errored).toBe(false)
})
})
})