From 8cf9b8955a78ff598671e98799a8b4b746a7c6b5 Mon Sep 17 00:00:00 2001 From: web-mech Date: Tue, 27 Aug 2024 19:05:59 -0400 Subject: [PATCH] test(clean): add more assertions for non-english test-cases add tests for cn + jp --- tests/filter.spec.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/filter.spec.ts b/tests/filter.spec.ts index 43b969c..d131404 100644 --- a/tests/filter.spec.ts +++ b/tests/filter.spec.ts @@ -106,7 +106,16 @@ test('clean: Should not throw exceptions when nothing but whitespace passed to f test('clean: Cleans non-english sentences', (t) => { const filter = new Filter() - const badwordtest = 'мило' - const teststring = filter.clean(badwordtest) - t.is(filter.clean(teststring), badwordtest) + const ruBadWordTest = 'мило' + const cnBadWordTest = '吃' + const jpBadWordTest = 'ワイン' + + let teststring = filter.clean(ruBadWordTest) + t.is(filter.clean(teststring), ruBadWordTest) + + teststring = filter.clean(cnBadWordTest) + t.is(filter.clean(teststring), cnBadWordTest) + + teststring = filter.clean(jpBadWordTest) + t.is(filter.clean(teststring), jpBadWordTest) })