Assume latest if no ol.VERSION

This commit is contained in:
Tim Schaub
2017-04-13 05:54:51 -06:00
parent dff5cc63e7
commit 525fba6405
2 changed files with 7 additions and 3 deletions

View File

@@ -6,8 +6,9 @@ goog.require('ol.AssertionError');
describe('ol.AssertionError', function() {
it('generates a message', function() {
var error = new ol.AssertionError(42);
expect(error.message).to.be('Assertion failed. See /doc/errors/#42 for details.');
expect(error.message).to.be('Assertion failed. See https://openlayers.org/en/latest/doc/errors/#42 for details.');
});
it('generates a message with a versioned url', function() {
var origVersion = ol.VERSION;
ol.VERSION = 'foo';
@@ -15,10 +16,12 @@ describe('ol.AssertionError', function() {
expect(error.message).to.be('Assertion failed. See https://openlayers.org/en/foo/doc/errors/#42 for details.');
ol.VERSION = origVersion;
});
it('has an error code', function() {
var error = new ol.AssertionError(42);
expect(error.code).to.be(42);
});
it('has a name', function() {
var error = new ol.AssertionError(42);
expect(error.name).to.be('AssertionError');