fix(string utils): do not escape possible regular expressions

This commit is contained in:
Matteo Pagliazzi
2020-04-28 16:47:52 +02:00
parent 2888f843e3
commit 61ca931e66
4 changed files with 16 additions and 19 deletions

View File

@@ -0,0 +1,12 @@
import { getMatchesByWordArray } from '../../../../website/server/libs/stringUtils';
import bannedWords from '../../../../website/server/libs/bannedWords';
describe('stringUtils', () => {
describe('getMatchesByWordArray', () => {
it('check all banned words are matched', async () => {
const message = bannedWords.join(',');
const matches = getMatchesByWordArray(message, bannedWords);
expect(matches.length).to.equal(bannedWords.length);
});
});
});