diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-03-24 08:49:39 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-03-24 08:49:39 +0100 |
commit | 275739a77838ef256eeebeb48838e97420783f45 (patch) | |
tree | 912d7b3c7a00124a0befad2a2b4c13ca5b8fd387 | |
parent | cb3a43ed8a1799dbf6cc94bea9c234ca1e20e209 (diff) | |
download | gitbook-275739a77838ef256eeebeb48838e97420783f45.zip gitbook-275739a77838ef256eeebeb48838e97420783f45.tar.gz gitbook-275739a77838ef256eeebeb48838e97420783f45.tar.bz2 |
Add basic test for website generation
-rw-r--r-- | test/json.js | 6 | ||||
-rw-r--r-- | test/website.js | 25 |
2 files changed, 31 insertions, 0 deletions
diff --git a/test/json.js b/test/json.js index 3ee2066..e86ee4e 100644 --- a/test/json.js +++ b/test/json.js @@ -38,6 +38,12 @@ describe('JSON generator', function () { page.sections[0].should.have.property("type").which.is.a.String.which.equal("normal"); }); + it('should contains valid progress', function() { + page.should.have.property("progress"); + page.progress.should.have.property("chapters").with.lengthOf(1); + page.progress.should.have.property("current"); + }); + it('should contains no languages', function() { page.should.have.property("langs").with.lengthOf(0); }); diff --git a/test/website.js b/test/website.js new file mode 100644 index 0000000..91340a0 --- /dev/null +++ b/test/website.js @@ -0,0 +1,25 @@ +var fs = require('fs'); +var path = require('path'); + +describe('Website generator', function () { + describe('Basic Book', function() { + var book; + + before(function() { + return books.generate("basic", "website") + .then(function(_book) { + book = _book; + }); + }); + + it('should correctly output an index.html', function() { + book.should.have.file("index.html"); + }); + + it('should correctly copy assets', function() { + book.should.have.file("gitbook"); + book.should.have.file("gitbook/app.js"); + book.should.have.file("gitbook/style.css"); + }); + }); +}); |