summaryrefslogtreecommitdiffstats
path: root/test/helper.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-19 15:26:31 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-19 15:26:31 +0100
commit793600ab2fe3923062b06dd25e59655805882409 (patch)
treec385fbadece8b41b69dbd995a94744a1370f01e2 /test/helper.js
parent354b4afba1ddd1f86fb587da0c74388df89dbc28 (diff)
downloadgitbook-793600ab2fe3923062b06dd25e59655805882409.zip
gitbook-793600ab2fe3923062b06dd25e59655805882409.tar.gz
gitbook-793600ab2fe3923062b06dd25e59655805882409.tar.bz2
Improve test to test a all book
Diffstat (limited to 'test/helper.js')
-rw-r--r--test/helper.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/helper.js b/test/helper.js
new file mode 100644
index 0000000..f80edcb
--- /dev/null
+++ b/test/helper.js
@@ -0,0 +1,19 @@
+var path = require('path');
+var Q = require('q');
+var Book = require('../').Book;
+
+// Nicety for mocha / Q
+global.qdone = function qdone(promise, done) {
+ return promise.then(function() {
+ return done();
+ }, function(err) {
+ return done(err);
+ }).done();
+};
+
+// Init before doing tests
+before(function(done) {
+ global.book1 = new Book(path.join(__dirname, './fixtures/test1'));
+
+ qdone(global.book1.init(), done);
+});