summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-05-27 10:54:56 +0200
committerSamy Pessé <samypesse@gmail.com>2016-05-27 10:54:56 +0200
commite2e0ca3f0585ab245bae91c7a48178454fe96a44 (patch)
tree66ecebab2b5ed45945bb6577c47cbc75302e039c /lib
parentb33a79704b686405e0730ff1baa61281c89b3c08 (diff)
downloadgitbook-e2e0ca3f0585ab245bae91c7a48178454fe96a44.zip
gitbook-e2e0ca3f0585ab245bae91c7a48178454fe96a44.tar.gz
gitbook-e2e0ca3f0585ab245bae91c7a48178454fe96a44.tar.bz2
Add test for plugin version resolution
Diffstat (limited to 'lib')
-rw-r--r--lib/plugins/__tests__/resolveVersion.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/plugins/__tests__/resolveVersion.js b/lib/plugins/__tests__/resolveVersion.js
index 164611f..1877c9e 100644
--- a/lib/plugins/__tests__/resolveVersion.js
+++ b/lib/plugins/__tests__/resolveVersion.js
@@ -2,13 +2,21 @@ var PluginDependency = require('../../models/pluginDependency');
var resolveVersion = require('../resolveVersion');
describe('resolveVersion', function() {
- it('must skip resolving and return non-semver versions', function(done) {
- var plugin = PluginDependency.createFromString('plugin-ga@git+ssh://samy@github.com/GitbookIO/plugin-ga.git');
+ it('must skip resolving and return non-semver versions', function() {
+ var plugin = PluginDependency.createFromString('ga@git+ssh://samy@github.com/GitbookIO/plugin-ga.git');
- resolveVersion(plugin)
+ return resolveVersion(plugin)
.then(function(version) {
expect(version).toBe('git+ssh://samy@github.com/GitbookIO/plugin-ga.git');
- done();
+ });
+ });
+
+ it('must resolve a normal plugin dependency', function() {
+ var plugin = PluginDependency.createFromString('ga@>0.9.0 < 1.0.1');
+
+ return resolveVersion(plugin)
+ .then(function(version) {
+ expect(version).toBe('1.0.0');
});
});
});