From a9744dd4a6c55bd270503ffa2d20c37440a98eb5 Mon Sep 17 00:00:00 2001 From: streamich Date: Sun, 10 Dec 2023 15:15:50 +0100 Subject: [PATCH] =?UTF-8?q?fix(json-pack):=20=F0=9F=90=9B=20allow=20emojis?= =?UTF-8?q?=20in=20strings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/json-pack/resp/RespEncoder.ts | 2 +- src/json-pack/resp/__tests__/RespDecoder.spec.ts | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/json-pack/resp/RespEncoder.ts b/src/json-pack/resp/RespEncoder.ts index a05aecbad6..ecfba86672 100644 --- a/src/json-pack/resp/RespEncoder.ts +++ b/src/json-pack/resp/RespEncoder.ts @@ -174,7 +174,7 @@ export class RespEncoder { describe('strings', () => { describe('simple strings', () => { - test('empty string', () => { - assertCodec(''); - }); - - test('short string', () => { - assertCodec('foo bar'); - }); + test('empty string', () => assertCodec('')); + test('short string', () => assertCodec('foo bar')); + test('short string with emoji', () => assertCodec('foo bar🍼')); + test('short string with emoji and newline', () => assertCodec('foo bar\n🍼')); test('simple string with newline', () => { assertCodec('foo\nbar');