-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.js
42 lines (31 loc) · 1.03 KB
/
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 test = require('tape');
const remark = require('remark');
const lint = require('remark-lint');
const alphabetizeLists = require('./');
const processor = remark().use(lint).use(alphabetizeLists);
const nok = `* [An Awesome Book](http://example.com/example.html)
### Example
* [Another Awesome Book](http://example.com/book.html)
* [Some Other Book](http://example.com/other.html)
`;
const ok = `* [An Awesome Book](http://example.com/example.html)
### Example
* [Another Awesome Book](http://example.com/book.html)
* [Some Other Book](http://example.com/other.html)
`;
test('remark-lint-alphabetize-lists', (t) => {
t.deepEqual(
processor.processSync(ok).messages.map(String),
[],
'should work on valid fixtures'
);
t.deepEqual(
processor.processSync(nok).messages.map(String),
[
'1:1-1:53: Incorrect number of blank lines between last section and next heading',
'3:1-3:12: Incorrect number of blank lines between heading and section'
],
'should work on valid fixtures'
);
t.end();
});