@@ -4,66 +4,61 @@ import lint from '../_lint';
4
4
const config = {
5
5
plugins : [
6
6
require ( 'remark-lint' ) ,
7
- /// require('remark-lint-no-empty-sections'),
8
7
require ( '../../rules/license' )
9
8
]
10
9
} ;
11
10
12
- test ( 'license - missing ' , async t => {
11
+ test ( 'licence - forbidden section ' , async t => {
13
12
const messages = await lint ( { config, filename : 'test/fixtures/license/error0.md' } ) ;
14
13
t . deepEqual ( messages , [
15
14
{
16
15
line : 1 ,
17
16
ruleId : 'awesome-license' ,
18
- message : 'Missing License section'
17
+ message : 'Forbidden license section found '
19
18
}
20
19
] ) ;
21
20
} ) ;
22
21
23
- test ( 'license - empty' , async t => {
22
+ test ( 'license - forbidden empty section ' , async t => {
24
23
const messages = await lint ( { config, filename : 'test/fixtures/license/error1.md' } ) ;
25
24
t . deepEqual ( messages , [
26
- // {
27
- // ruleId: 'no-empty-sections',
28
- // message: 'Remove empty section: "License"'
29
- // },
30
25
{
31
- line : 11 ,
26
+ line : 1 ,
32
27
ruleId : 'awesome-license' ,
33
- message : 'License must not be empty '
28
+ message : 'Forbidden license section found '
34
29
}
35
30
] ) ;
36
31
} ) ;
37
32
38
- test ( 'license - not last section' , async t => {
33
+ test ( 'license - forbidden last section' , async t => {
39
34
const messages = await lint ( { config, filename : 'test/fixtures/license/error2.md' } ) ;
40
35
t . deepEqual ( messages , [
41
36
{
42
- line : 11 ,
37
+ line : 1 ,
43
38
ruleId : 'awesome-license' ,
44
- message : 'License must be the last section'
39
+ message : 'Forbidden license section found '
45
40
}
46
41
] ) ;
47
42
} ) ;
48
43
49
- test ( 'license - incorrect heading depth' , async t => {
44
+ test ( 'license - forbidden heading depth section ' , async t => {
50
45
const messages = await lint ( { config, filename : 'test/fixtures/license/error3.md' } ) ;
51
46
t . deepEqual ( messages , [
52
47
{
53
- line : 11 ,
48
+ line : 1 ,
54
49
ruleId : 'awesome-license' ,
55
- message : 'License section must be at heading depth 2 '
50
+ message : 'Forbidden license section found '
56
51
}
57
52
] ) ;
58
53
} ) ;
59
54
60
- test ( 'license - png image' , async t => {
55
+ test ( 'license - forbidden image section ' , async t => {
61
56
const messages = await lint ( { config, filename : 'test/fixtures/license/error4.md' } ) ;
62
57
t . deepEqual ( messages , [
63
58
{
64
- line : 3 ,
59
+ line : 1 ,
65
60
ruleId : 'awesome-license' ,
66
- message : 'License image must be SVG '
61
+ message : 'Forbidden license section found '
67
62
}
68
63
] ) ;
69
64
} ) ;
0 commit comments