diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-01-22 19:09:03 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-01-22 19:09:03 +0100 |
commit | 9e172549d162ce6ec2d0e454db997418a2b9795f (patch) | |
tree | e31811c32a9b3d418a7d70a66a84d5caeb6f7175 /test/json.js | |
parent | 0ba36c6f4ed316cc157c701abe4728d64da231b4 (diff) | |
download | gitbook-9e172549d162ce6ec2d0e454db997418a2b9795f.zip gitbook-9e172549d162ce6ec2d0e454db997418a2b9795f.tar.gz gitbook-9e172549d162ce6ec2d0e454db997418a2b9795f.tar.bz2 |
Mark glossary terms in html parsed
Diffstat (limited to 'test/json.js')
-rw-r--r-- | test/json.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/json.js b/test/json.js index 1af2517..1620d00 100644 --- a/test/json.js +++ b/test/json.js @@ -5,7 +5,16 @@ var assert = require('assert'); var fs = require("fs"); describe('JSON generator', function () { - it('should correctly generate a book to json', function(done) { + it('should correctly generate a book to json with glossary', function(done) { + testGeneration(books[0], "json", function(output) { + assert(fs.existsSync(path.join(output, "README.json"))); + + var readme = JSON.parse(fs.readFileSync(path.join(output, "README.json"))); + assert(readme.sections[0].content.indexOf('class="glossary-term"') > 0); + }, done); + }); + + it('should correctly generate a book to json with sub folders', function(done) { testGeneration(books[1], "json", function(output) { assert(!fs.existsSync(path.join(output, "README.json"))); assert(fs.existsSync(path.join(output, "intro.json"))); |