Merge pull request #6707 from tschaub/errors-url

Set version when building ol package
This commit is contained in:
Tim Schaub
2017-04-13 20:24:36 -06:00
committed by GitHub
5 changed files with 20 additions and 4 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');