fix: fixed linting

This commit is contained in:
Wyatt Johnson
2018-10-25 12:03:28 -06:00
parent 6dab5836c3
commit d1e6d297f3
3 changed files with 2 additions and 48 deletions
@@ -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 = ({
@@ -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",
@@ -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);
});
});