diff --git a/core/tests/Drupal/Nightwatch/Assertions/deprecationErrorExists.js b/core/tests/Drupal/Nightwatch/Assertions/deprecationErrorExists.js index 0b8b9f64f56..e1afee8ea78 100644 --- a/core/tests/Drupal/Nightwatch/Assertions/deprecationErrorExists.js +++ b/core/tests/Drupal/Nightwatch/Assertions/deprecationErrorExists.js @@ -7,7 +7,7 @@ module.exports.assertion = function (expected) { const deprecationMessages = sessionStorageEntries !== null ? sessionStorageEntries.filter((message) => - new RegExp('[Deprecation]').test(message), + message.includes('[Deprecation]'), ) : []; diff --git a/core/tests/Drupal/Nightwatch/Assertions/noDeprecationErrors.js b/core/tests/Drupal/Nightwatch/Assertions/noDeprecationErrors.js index 8d5ab79b9e8..2fb004e64f2 100644 --- a/core/tests/Drupal/Nightwatch/Assertions/noDeprecationErrors.js +++ b/core/tests/Drupal/Nightwatch/Assertions/noDeprecationErrors.js @@ -7,7 +7,7 @@ module.exports.assertion = function () { const deprecationMessages = sessionStorageEntries !== null ? sessionStorageEntries.filter((message) => - new RegExp('[Deprecation]').test(message), + message.includes('[Deprecation]'), ) : [];