diff --git a/client/src/utils/text.test.js b/client/src/utils/text.test.js index 06a257929a2..00595b6484e 100644 --- a/client/src/utils/text.test.js +++ b/client/src/utils/text.test.js @@ -1,5 +1,10 @@ import { cleanForSlug, escapeHtml } from './text'; +// load window.XRegExp polyfill +import { XRegExp } from '../../../wagtail/admin/static_src/wagtailadmin/js/vendor/xregexp.min'; + +window.XRegExp = XRegExp; + describe('escapeHtml', () => { it('should escape the supplied HTML', () => { expect(escapeHtml('7 is > than 5 & 3')).toEqual('7 is > than 5 & 3');