UNPKG

gitbook-html

Version:

Parse HTML content for gitbook

31 lines (23 loc) 785 B
var fs = require('fs'); var path = require('path'); var assert = require('assert'); var readme = require('../').readme; describe('Readme parsing', function () { var LEXED; before(function() { var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/README.html'), 'utf8'); LEXED = readme(CONTENT); }); it('should contain a title', function() { assert(LEXED.title); }); it('should contain a description', function() { assert(LEXED.description); }); it('should extract the right title', function() { assert.equal(LEXED.title, "This is the title"); }); it('should extract the right description', function() { assert.equal(LEXED.description, "This is the book description."); }); });