summaryrefslogtreecommitdiffstats
path: root/lib/plugins/__tests__/sortPlugins.js
diff options
context:
space:
mode:
authorSamy Pesse <samypesse@gmail.com>2016-06-10 22:08:16 +0200
committerSamy Pesse <samypesse@gmail.com>2016-06-10 22:08:16 +0200
commit1e3d871c1e288b58dc486053cc7fa0f274c4cf31 (patch)
tree5f221cb283e5f4591a3764112569ee62220e6da2 /lib/plugins/__tests__/sortPlugins.js
parent50a132cb2c0b0666b3b067e32d37e10bfb9e50da (diff)
parent94a4310c1e4b9ee71def9cbd9efd8a4c491f4444 (diff)
downloadgitbook-1e3d871c1e288b58dc486053cc7fa0f274c4cf31.zip
gitbook-1e3d871c1e288b58dc486053cc7fa0f274c4cf31.tar.gz
gitbook-1e3d871c1e288b58dc486053cc7fa0f274c4cf31.tar.bz2
Merge branch 'fix/plugins_loading'
Diffstat (limited to 'lib/plugins/__tests__/sortPlugins.js')
-rw-r--r--lib/plugins/__tests__/sortPlugins.js45
1 files changed, 0 insertions, 45 deletions
diff --git a/lib/plugins/__tests__/sortPlugins.js b/lib/plugins/__tests__/sortPlugins.js
deleted file mode 100644
index 4aa26a3..0000000
--- a/lib/plugins/__tests__/sortPlugins.js
+++ /dev/null
@@ -1,45 +0,0 @@
-var Immutable = require('immutable');
-
-var Plugin = require('../../models/plugin');
-var sortPlugins = require('../sortPlugins');
-var toNames = require('../toNames');
-
-describe('sortPlugins', function() {
- it('must load themes after plugins', function() {
- var allPlugins = Immutable.OrderedMap([
- ['hello', Plugin.createFromString('hello')],
- ['theme-test', Plugin.createFromString('theme-test')],
- ['world', Plugin.createFromString('world')]
- ]);
-
- var sorted = sortPlugins(allPlugins);
- var names = toNames(sorted);
-
- expect(names).toEqual([
- 'hello',
- 'world',
- 'theme-test'
- ]);
- });
-
- it('must keep order of themes', function() {
- var allPlugins = Immutable.OrderedMap([
- ['theme-test', Plugin.createFromString('theme-test')],
- ['theme-test1', Plugin.createFromString('theme-test1')],
- ['hello', Plugin.createFromString('hello')],
- ['theme-test2', Plugin.createFromString('theme-test2')],
- ['world', Plugin.createFromString('world')]
- ]);
-
- var sorted = sortPlugins(allPlugins);
- var names = toNames(sorted);
-
- expect(names).toEqual([
- 'hello',
- 'world',
- 'theme-test',
- 'theme-test1',
- 'theme-test2'
- ]);
- });
-}); \ No newline at end of file