diff options
Diffstat (limited to 'lib/plugins/__tests__')
-rw-r--r-- | lib/plugins/__tests__/findForBook.js | 19 | ||||
-rw-r--r-- | lib/plugins/__tests__/locateRootFolder.js | 10 |
2 files changed, 29 insertions, 0 deletions
diff --git a/lib/plugins/__tests__/findForBook.js b/lib/plugins/__tests__/findForBook.js new file mode 100644 index 0000000..d8af2e9 --- /dev/null +++ b/lib/plugins/__tests__/findForBook.js @@ -0,0 +1,19 @@ +var path = require('path'); + +var Book = require('../../models/book'); +var createNodeFS = require('../../fs/node'); +var findForBook = require('../findForBook'); + +describe('findForBook', function() { + var fs = createNodeFS( + path.resolve(__dirname, '../../..') + ); + var book = Book.createForFS(fs); + + it('should list default plugins', function() { + return findForBook(book) + .then(function(plugins) { + expect(plugins.has('fontsettings')).toBeTruthy(); + }); + }); +}); diff --git a/lib/plugins/__tests__/locateRootFolder.js b/lib/plugins/__tests__/locateRootFolder.js new file mode 100644 index 0000000..bb414a3 --- /dev/null +++ b/lib/plugins/__tests__/locateRootFolder.js @@ -0,0 +1,10 @@ +var path = require('path'); +var locateRootFolder = require('../locateRootFolder'); + +describe('locateRootFolder', function() { + it('should correctly resolve the node_modules for gitbook', function() { + expect(locateRootFolder()).toBe( + path.resolve(__dirname, '../../../') + ); + }); +}); |