Move assertion messages into code and deprecate AssertionError

This commit is contained in:
Andreas Hocevar
2022-08-21 21:41:27 +02:00
parent c5f8629f65
commit 4e9626ef60
3 changed files with 69 additions and 13 deletions

View File

@@ -1,6 +1,5 @@
import AssertionError from '../../../src/ol/AssertionError.js';
import expect from '../expect.js';
import {VERSION} from '../../../src/ol/util.js';
describe('ol/AssertionError.js', function () {
it('generates an error', function () {
@@ -10,11 +9,8 @@ describe('ol/AssertionError.js', function () {
it('generates a message with a versioned url', function () {
const error = new AssertionError(42);
const path = VERSION ? VERSION.split('-')[0] : 'latest';
expect(error.message).to.be(
'Assertion failed. See https://openlayers.org/en/' +
path +
'/doc/errors/#42 for details.'
'Assertion failed. Question unknown, the answer is 42.'
);
});