diff options
Diffstat (limited to 'spec/frontend/test_setup.js')
-rw-r--r-- | spec/frontend/test_setup.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/frontend/test_setup.js b/spec/frontend/test_setup.js index 2c8e0fff848..40f68c6385f 100644 --- a/spec/frontend/test_setup.js +++ b/spec/frontend/test_setup.js @@ -47,10 +47,12 @@ Object.assign(global, { setFixtures: setHTMLFixture, }); +const JQUERY_MATCHERS_TO_EXCLUDE = ['toHaveLength', 'toExist']; + // custom-jquery-matchers was written for an old Jest version, we need to make it compatible Object.entries(jqueryMatchers).forEach(([matcherName, matcherFactory]) => { - // Don't override existing Jest matcher - if (matcherName === 'toHaveLength') { + // Exclude these jQuery matchers + if (JQUERY_MATCHERS_TO_EXCLUDE.includes(matcherName)) { return; } |