mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-17 16:15:22 +00:00
465e8d6c0a
Fixed issue in pluginDependency to dereference 'name' and 'version' using Immutable Map.get(...) accessors since config values are now wrapped by Immutable.fromJS(...) in config.js > setValue(...). Added associated unit test. Fixed issue in resolveVersion where a plugin may be using a git URL rather than a semver for the version portion of the plugin config definition. In addition, refactored the resolveVersion function into a new module to allow for unit testing. Added associated unit test.
15 lines
551 B
JavaScript
15 lines
551 B
JavaScript
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');
|
|
|
|
resolveVersion(plugin)
|
|
.then(function(version) {
|
|
expect(version).toBe('git+ssh://samy@github.com/GitbookIO/plugin-ga.git');
|
|
done();
|
|
});
|
|
});
|
|
});
|