mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-16 15:45:13 +00:00
23 lines
595 B
JavaScript
23 lines
595 B
JavaScript
var fs = require('fs');
|
|
var path = require('path');
|
|
var assert = require('assert');
|
|
|
|
var lex = require('../').parse.lex;
|
|
|
|
|
|
var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/SECTIONS.md'), 'utf8');
|
|
var LEXED = lex(CONTENT);
|
|
|
|
|
|
describe('Section parsing', function() {
|
|
it('should correctly split sections', function() {
|
|
assert.equal(LEXED.length, 3);
|
|
});
|
|
|
|
it('should robustly detect exercises', function() {
|
|
assert.equal(LEXED[0].type, 'normal');
|
|
assert.equal(LEXED[1].type, 'exercise');
|
|
assert.equal(LEXED[2].type, 'exercise');
|
|
});
|
|
});
|