summaryrefslogtreecommitdiffstats
path: root/test/helper.js
blob: f80edcb7a2df5f97ed16433901a618daadba24b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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);
});