mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-21 01:53:26 +00:00
Improve lib/plugins/__tests__/findInstalled.js
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user