summaryrefslogtreecommitdiffstats
path: root/test/helper.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/helper.js')
-rw-r--r--test/helper.js25
1 files changed, 12 insertions, 13 deletions
diff --git a/test/helper.js b/test/helper.js
index 341b698..fbdd85c 100644
--- a/test/helper.js
+++ b/test/helper.js
@@ -31,22 +31,21 @@ global.testGeneration = function(book, type, func, done) {
};
// Books for testings
-global.books = [];
+var books = fs.readdirSync(path.join(__dirname, './fixtures/'));
+
+global.books = _.chain(books)
+ .sortBy()
+ .map(function(book) {
+ if (book.indexOf("test") !== 0) return null;
+ return new Book(path.join(__dirname, './fixtures/', book), {
+ logLevel: Book.LOG_LEVELS.DISABLED
+ });
+ })
+ .compact()
+ .value();
// Init before doing tests
before(function(done) {
- var books = fs.readdirSync(path.join(__dirname, './fixtures/'));
-
- global.books = _.chain(books)
- .sortBy()
- .map(function(book) {
- if (book.indexOf("test") !== 0) return null;
- return new Book(path.join(__dirname, './fixtures/', book), {
- logLevel: Book.LOG_LEVELS.DISABLED
- });
- })
- .compact()
- .value();
qdone(
_.reduce(global.books, function(prev, book) {