diff options
Diffstat (limited to 'test/helper.js')
-rw-r--r-- | test/helper.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/helper.js b/test/helper.js index f6b671b..ef5c45c 100644 --- a/test/helper.js +++ b/test/helper.js @@ -17,9 +17,17 @@ var TMPDIR = os.tmpdir(); // Generate and return a book -function generateBook(bookId, test) { +function generateBook(bookId, test, options) { + options = _.defaults(options || {}, { + before: function() {} + }); + return parseBook(bookId, test) .then(function(book) { + return Q(options.before(book)) + .thenResolve(book); + }) + .then(function(book) { return book.generate(test) .thenResolve(book); }); |