diff --git a/test/util/string_utils_unit.js b/test/util/string_utils_unit.js index 92c6f6765..bd8fc4b6d 100644 --- a/test/util/string_utils_unit.js +++ b/test/util/string_utils_unit.js @@ -12,15 +12,9 @@ describe('StringUtils', () => { }); describe('without TextDecoder', () => { - let originalTextDecoder; - - beforeAll(() => { - originalTextDecoder = window.TextDecoder; - window['TextDecoder'] = null; - }); - - afterAll(() => { - window.TextDecoder = originalTextDecoder; + beforeEach(() => { + spyOn(deviceDetected, 'shouldAvoidUseTextDecoderEncoder') + .and.returnValue(true); }); defineStringUtilTests();