diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-06-10 17:15:04 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-06-10 17:15:04 +0200 |
commit | 7a08b3f109d104903406a38cfd33aa642d30211f (patch) | |
tree | 30883947deb3d2218c2255ce84a2bc1ad2b61d7e /lib/plugins/__tests__ | |
parent | 94d4234cb8523d080cfba87b4a51e3ebcffc4159 (diff) | |
download | gitbook-7a08b3f109d104903406a38cfd33aa642d30211f.zip gitbook-7a08b3f109d104903406a38cfd33aa642d30211f.tar.gz gitbook-7a08b3f109d104903406a38cfd33aa642d30211f.tar.bz2 |
Fix #1377: fix listing of plugins when using gitbook as a library
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, '../../../') + ); + }); +}); |