summaryrefslogtreecommitdiffstats
path: root/test/helper.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-26 16:08:39 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-26 16:08:39 +0100
commit3293c394508ef40a65068a19f04deda467431864 (patch)
treefa94a2d78affd7c92e65a09cb472bbb8985023d7 /test/helper.js
parent5b447d030b0f7dfb1957372fc324de33ba5cca5c (diff)
downloadgitbook-3293c394508ef40a65068a19f04deda467431864.zip
gitbook-3293c394508ef40a65068a19f04deda467431864.tar.gz
gitbook-3293c394508ef40a65068a19f04deda467431864.tar.bz2
Add test for plugin resources
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) {