mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-17 16:44:49 -04:00
fix(repository): Move backend code into subdirectory
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
86584e705f
commit
bf30cbcf48
272 changed files with 87 additions and 67 deletions
38
backend/src/logger/console-logger.service.spec.ts
Normal file
38
backend/src/logger/console-logger.service.spec.ts
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
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');
|
||||
}
|
||||
});
|
||||
it('replaces non-zero-width space with space', () => {
|
||||
const nonZeroWidthSpaces = [
|
||||
'\u0020', // space
|
||||
'\u00A0', // non-breaking space
|
||||
'\u2000', // en quad
|
||||
'\u2001', // en quad
|
||||
'\u2002', // en space
|
||||
'\u2003', // en space
|
||||
'\u2004', // three-per-em space
|
||||
'\u2005', // four-per-em space
|
||||
'\u2006', // six-per-em space
|
||||
'\u2007', // figure space
|
||||
'\u2008', // punctuation space
|
||||
'\u2009', // thin space
|
||||
'\u200a', // hair space
|
||||
'\u202F', // narrow no-break space
|
||||
'\u205F', // medium mathematical space
|
||||
'\u3000', // ideographic space
|
||||
];
|
||||
nonZeroWidthSpaces.forEach((space) => {
|
||||
expect(ConsoleLoggerService.sanitize(`c${space}d`)).toEqual('c d');
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue