mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-18 00:25:07 +00:00
23 lines
738 B
JavaScript
23 lines
738 B
JavaScript
var path = require('path');
|
|
var assert = require('assert');
|
|
|
|
var Book = require('../').Book;
|
|
|
|
describe('Summary parsing', function () {
|
|
it('should correctly parse it from markdown', function(done) {
|
|
var book = new Book(path.join(__dirname, './fixtures/summary/markdown'));
|
|
book.parseSummary()
|
|
.then(function() {
|
|
var LEXED = book.summary;
|
|
|
|
assert.equal(LEXED.chapters[0].path,'README.md');
|
|
assert.equal(LEXED.chapters[1].path,'chapter-1/README.md');
|
|
assert.equal(LEXED.chapters[2].path,'chapter-2/README.md');
|
|
assert.equal(LEXED.chapters[3].path,'chapter-3/README.md');
|
|
})
|
|
.then(function() {
|
|
done()
|
|
}, done);
|
|
});
|
|
});
|