From 69d625188c50e7acb2f8b87bed69ae06a2e0fe81 Mon Sep 17 00:00:00 2001 From: Erik Michelson Date: Sun, 8 Jan 2023 22:33:13 +0100 Subject: [PATCH] fix(tests): syntax for loop in console-logger service Signed-off-by: Erik Michelson Signed-off-by: Philip Molares --- backend/src/logger/console-logger.service.spec.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/src/logger/console-logger.service.spec.ts b/backend/src/logger/console-logger.service.spec.ts index ae47a99ea..da09438ca 100644 --- a/backend/src/logger/console-logger.service.spec.ts +++ b/backend/src/logger/console-logger.service.spec.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,9 +7,11 @@ import { ConsoleLoggerService } from './console-logger.service'; describe('sanitize', () => { it('removes non-printable ASCII character', () => { - for (let i = 0; i++; i < 32) { - const hexString = i.toString(16); - expect(ConsoleLoggerService.sanitize(`a${hexString}b`)).toEqual('ab'); + for (let i = 0; i < 32; i++) { + const nonPrintableString = String.fromCharCode(i); + expect(ConsoleLoggerService.sanitize(`a${nonPrintableString}b`)).toEqual( + 'ab', + ); } }); it('replaces non-zero-width space with space', () => {