From d1e6d297f38fc899ae121bf15d8a3b349a521020 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Thu, 25 Oct 2018 12:03:28 -0600 Subject: [PATCH] fix: fixed linting --- .../comments/moderation/phases/wordList.ts | 2 +- .../comments/moderation/wordList.spec.ts | 2 +- .../comments/moderation/wordlist.spec.ts | 46 ------------------- 3 files changed, 2 insertions(+), 48 deletions(-) delete mode 100644 src/core/server/services/comments/moderation/wordlist.spec.ts diff --git a/src/core/server/services/comments/moderation/phases/wordList.ts b/src/core/server/services/comments/moderation/phases/wordList.ts index a014bff94..8a9d2eab0 100755 --- a/src/core/server/services/comments/moderation/phases/wordList.ts +++ b/src/core/server/services/comments/moderation/phases/wordList.ts @@ -7,7 +7,7 @@ import { IntermediateModerationPhase, IntermediatePhaseResult, } from "talk-server/services/comments/moderation"; -import { containsMatchingPhraseMemoized } from "talk-server/services/comments/moderation/wordlist"; +import { containsMatchingPhraseMemoized } from "talk-server/services/comments/moderation/wordList"; // This phase checks the comment against the wordList. export const wordList: IntermediateModerationPhase = ({ diff --git a/src/core/server/services/comments/moderation/wordList.spec.ts b/src/core/server/services/comments/moderation/wordList.spec.ts index d23705ecf..5e68398b1 100644 --- a/src/core/server/services/comments/moderation/wordList.spec.ts +++ b/src/core/server/services/comments/moderation/wordList.spec.ts @@ -1,4 +1,4 @@ -import { containsMatchingPhrase } from "talk-server/services/comments/moderation/wordlist"; +import { containsMatchingPhrase } from "talk-server/services/comments/moderation/wordList"; const phrases = [ "cookies", diff --git a/src/core/server/services/comments/moderation/wordlist.spec.ts b/src/core/server/services/comments/moderation/wordlist.spec.ts deleted file mode 100644 index d23705ecf..000000000 --- a/src/core/server/services/comments/moderation/wordlist.spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { containsMatchingPhrase } from "talk-server/services/comments/moderation/wordlist"; - -const phrases = [ - "cookies", - "how to do bad things", - "how to do really bad things", - "s h i t", - "$hit", - "p**ch", - "p*ch", -]; - -describe("containsMatchingPhrase", () => { - it("does match on a word in the list", () => { - [ - "how to do really bad things", - "what is cookies", - "cookies", - "COOKIES.", - "how to do bad things", - "How To do bad things!", - "This stuff is $hit!", - "That's a p**ch!", - ].forEach(word => { - expect(containsMatchingPhrase(phrases, word)).toEqual(true); - }); - }); - - it("does not match on a word not in the list", () => { - [ - "how to", - "cookie", - "how to be a great person?", - "how to not do really bad things?", - "i have $100 dollars.", - "I have bad $ hit lling", - "That's a p***ch!", - ].forEach(word => { - expect(containsMatchingPhrase(phrases, word)).toEqual(false); - }); - }); - - it("allows an empty list", () => { - expect(containsMatchingPhrase([], "test")).toEqual(false); - }); -});