diff --git a/packages/devextreme-monorepo-tools/src/version-utils.ts b/packages/devextreme-monorepo-tools/src/version-utils.ts index f4ee61855060..ce6861413919 100644 --- a/packages/devextreme-monorepo-tools/src/version-utils.ts +++ b/packages/devextreme-monorepo-tools/src/version-utils.ts @@ -7,6 +7,10 @@ export function validateVersion(version: string | undefined): string { } export function formatVersion(version: string | undefined): string | undefined { + if (version?.length && version.length > 1000) { + throw new Error("version string is too long"); + } + return version?.match(/(\d+\.\d+\.\d+)(\D|$)/)?.[1]; } diff --git a/packages/devextreme/testing/helpers/vectormaputils-tester.js b/packages/devextreme/testing/helpers/vectormaputils-tester.js index 0d3fbd8820c6..210b1d845db1 100644 --- a/packages/devextreme/testing/helpers/vectormaputils-tester.js +++ b/packages/devextreme/testing/helpers/vectormaputils-tester.js @@ -67,7 +67,7 @@ require('http').createServer(function(request, response) { const info = getRequestInfo(request.url); const action = actions[info.action]; response.writeHead(200, { 'Content-Type': 'text/plain' }); - if(action) { + if(action && typeof action === 'function') { action(info.arg, callback); } function callback(data) { diff --git a/packages/devextreme/testing/tests/DevExpress.core/utils.ajax.tests.js b/packages/devextreme/testing/tests/DevExpress.core/utils.ajax.tests.js index ba94b4c13d08..c7039c11c0b4 100644 --- a/packages/devextreme/testing/tests/DevExpress.core/utils.ajax.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.core/utils.ajax.tests.js @@ -404,9 +404,9 @@ QUnit.test('Send data with request (cached resources)', function(assert) { // https://github.com/jquery/jquery/issues/2658 if(compareVersion($.fn.jquery, [3], 1) < 0) { if(testData[i].requestBody) { - testData[i].requestBody = testData[i].requestBody.replace('%20', '+'); + testData[i].requestBody = testData[i].requestBody.replace(/%20/g, '+'); } - testData[i].url = testData[i].url.replace('%20', '+'); + testData[i].url = testData[i].url.replace(/%20/g, '+'); } assert.equal(this.requests[i].url, testData[i].url, 'url for element ' + i + ' from test data'); assert.equal(this.requests[i].requestBody, testData[i].requestBody, 'requestBody for element ' + i + ' from test data'); diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets/loadIndicator.markup.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets/loadIndicator.markup.tests.js index 43cecaf513af..e86e0f19aff6 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets/loadIndicator.markup.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets/loadIndicator.markup.tests.js @@ -21,7 +21,7 @@ const LOADINDICATOR_IMAGE = 'dx-loadindicator-image'; const isIdenticalNamesInUrl = function(firstUrl, secondUrl) { let firstName = firstUrl.split('/'); - firstName = firstName[firstName.length - 1].replace(')', '').replace('"', ''); + firstName = firstName[firstName.length - 1].replace(/\)/g, '').replace(/"/g, ''); let secondName = secondUrl.split('/'); secondName = secondName[secondName.length - 1]; return firstName === secondName;