blob: efa77dbaa82397ac3e15191320adefe0bf66e72f (
plain)
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
|
var fs = require('fs');
var path = require('path');
var assert = require('assert');
var glossary = require('../').glossary;
var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/GLOSSARY.md'), 'utf8');
var LEXED = glossary(CONTENT);
describe('Glossary parsing', function () {
it('should only get heading + paragraph pairs', function() {
assert.equal(LEXED.length, 5);
});
it('should output simple name/description objects', function() {
assert.equal(true, !(LEXED.some(function(e) {
return !Boolean(e.name && e.description);
})));
});
it('should correctly convert it to text', function() {
var text = glossary.toText(LEXED);
assertObjectsEqual(glossary(text), LEXED);
});
});
|