summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-02-22 15:46:53 +0100
committerSamy Pessé <samypesse@gmail.com>2016-02-22 15:46:53 +0100
commitc7b1d72bf0bec4758958040f375632305bbbffbe (patch)
treee848145247cf3273535b54f24a84e362a47a328f /test
parent0b3bdcb2193e10f5bf0f6959475563d8c430aa40 (diff)
downloadgitbook-c7b1d72bf0bec4758958040f375632305bbbffbe.zip
gitbook-c7b1d72bf0bec4758958040f375632305bbbffbe.tar.gz
gitbook-c7b1d72bf0bec4758958040f375632305bbbffbe.tar.bz2
Add basic test for ebook generation
Diffstat (limited to 'test')
-rw-r--r--test/all.js1
-rw-r--r--test/output-ebook.js33
-rw-r--r--test/output-website.js4
3 files changed, 38 insertions, 0 deletions
diff --git a/test/all.js b/test/all.js
index d8f2275..5a96e38 100644
--- a/test/all.js
+++ b/test/all.js
@@ -23,3 +23,4 @@ require('./page');
require('./assets-inliner');
require('./output-json');
require('./output-website');
+require('./output-ebook');
diff --git a/test/output-ebook.js b/test/output-ebook.js
new file mode 100644
index 0000000..c43fc55
--- /dev/null
+++ b/test/output-ebook.js
@@ -0,0 +1,33 @@
+var mock = require('./mock');
+var EbookOutput = require('../lib/output/ebook');
+
+describe('Ebook Output', function() {
+ describe('Sample Book', function() {
+ var output;
+
+ before(function() {
+ return mock.outputDefaultBook(EbookOutput)
+ .then(function(_output) {
+ output = _output;
+ });
+ });
+
+ it('should correctly generate an index.html', function() {
+ output.should.have.file('index.html');
+ });
+
+ it('should correctly generate a SUMMARY.html', function() {
+ output.should.have.file('index.html');
+ });
+
+ it('should correctly copy assets', function() {
+ output.should.have.file('gitbook/ebook.css');
+ });
+
+ it('should correctly copy plugins', function() {
+ output.should.have.file('gitbook/gitbook-plugin-highlight/ebook.css');
+ });
+
+ });
+
+});
diff --git a/test/output-website.js b/test/output-website.js
index 9fe1928..69adf88 100644
--- a/test/output-website.js
+++ b/test/output-website.js
@@ -22,6 +22,10 @@ describe('Website Output', function() {
output.should.have.file('gitbook/images/favicon.ico');
});
+ it('should correctly copy plugins', function() {
+ output.should.have.file('gitbook/gitbook-plugin-highlight/website.css');
+ });
+
});
describe('Book with chapters', function() {