-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
63 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
import Filter from "./Filter"; | ||
import Filter from './Filter'; | ||
export { Filter }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
import { Filter } from "../src"; | ||
describe("test profanity", () => { | ||
it("return false English", () => { | ||
import { Filter } from '../src'; | ||
describe('test profanity', () => { | ||
it('return false English', () => { | ||
const filter = new Filter(); | ||
expect(filter.isProfane("he is going home")).toBe(false); | ||
expect(filter.isProfane('he is going home')).toBe(false); | ||
}); | ||
it("return true English", () => { | ||
it('return true English', () => { | ||
const filter = new Filter(); | ||
expect(filter.isProfane("he is going fucking home")).toBe(true); | ||
expect(filter.isProfane('he is going fucking home')).toBe(true); | ||
}); | ||
|
||
it("return false Arabic", () => { | ||
const filter = new Filter({ languages: ["arabic"] }); | ||
it('return false Arabic', () => { | ||
const filter = new Filter({ languages: ['arabic'] }); | ||
|
||
expect(filter.isProfane("ذهب محمد الى الحديقة")).toBe(false); | ||
expect(filter.isProfane('ذهب محمد الى الحديقة')).toBe(false); | ||
}); | ||
it("return true Arabic", () => { | ||
const filter = new Filter({ languages: ["arabic"] }); | ||
it('return true Arabic', () => { | ||
const filter = new Filter({ languages: ['arabic'] }); | ||
|
||
expect(filter.isProfane("الراجل بتاع السوبر ماركت معرص")).toBe(true); | ||
expect(filter.isProfane('الراجل بتاع السوبر ماركت معرص')).toBe(true); | ||
}); | ||
}); |