summaryrefslogtreecommitdiffstats
path: root/lib/plugins
diff options
context:
space:
mode:
authorJohan Preynat <johan.preynat@gmail.com>2016-05-02 15:06:00 +0200
committerJohan Preynat <johan.preynat@gmail.com>2016-05-02 15:06:02 +0200
commitfa6fcffbe122ec9b4723d5906f9daad348c6172b (patch)
treecc9b3b947580baf695b0c673ced88857b707f9f3 /lib/plugins
parent93d3f118910cc1ff2f46e8011c2df742210df087 (diff)
downloadgitbook-fa6fcffbe122ec9b4723d5906f9daad348c6172b.zip
gitbook-fa6fcffbe122ec9b4723d5906f9daad348c6172b.tar.gz
gitbook-fa6fcffbe122ec9b4723d5906f9daad348c6172b.tar.bz2
Improve lib/plugins/__tests__/findInstalled.js
Diffstat (limited to 'lib/plugins')
-rw-r--r--lib/plugins/__tests__/findInstalled.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/plugins/__tests__/findInstalled.js b/lib/plugins/__tests__/findInstalled.js
index e313c86..85e133f 100644
--- a/lib/plugins/__tests__/findInstalled.js
+++ b/lib/plugins/__tests__/findInstalled.js
@@ -1,12 +1,21 @@
var path = require('path');
+var Immutable = require('immutable');
describe('findInstalled', function() {
var findInstalled = require('../findInstalled');
pit('must list default plugins for gitbook directory', function() {
+ // Read gitbook-plugins from package.json
+ var pkg = require(path.resolve(__dirname, '../../../package.json'));
+ var gitbookPlugins = Immutable.Seq(pkg.dependencies)
+ .filter(function(v, k) {
+ return k.indexOf('gitbook-plugin') === 0;
+ })
+ .cacheResult();
+
return findInstalled(path.resolve(__dirname, '../../../'))
.then(function(plugins) {
- expect(plugins.size > 6).toBeTruthy();
+ expect(plugins.size >= gitbookPlugins.size).toBeTruthy();
expect(plugins.has('fontsettings')).toBe(true);
expect(plugins.has('search')).toBe(true);