Skip to content

Commit

Permalink
test(removeWords): update removeWords tests
Browse files Browse the repository at this point in the history
add test illustrating how an array should be used with the method

web-mech#45
  • Loading branch information
web-mech committed Oct 23, 2018
1 parent 855ea24 commit 4456f3a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions test/removeWords.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ var Filter = require('../lib/badwords.js'),
filter = new Filter(),
assert = require('better-assert');

describe('filter', function(){
describe('removeWords',function(){
it("Should allow you to remove words from the filter blacklist and no longer filter them",function(){
let removingWords = ['hells', 'yea'];
filter.removeWords(...removingWords);
describe('filter', () => {
describe('removeWords',() => {
it('Should allow you to remove words from the filter blacklist and no longer filter them', () => {
filter.removeWords('hells');
assert(filter.clean('This is a hells good test') === 'This is a hells good test');
filter.addWords('hells');
assert(filter.clean('This is a hells good test') === 'This is a ***** good test');
});

it ('Should allow you to remove an array of words from the filter blacklist and no longer filter them', () => {
let removingWords = ['hells', 'sadist'];
filter.removeWords(...removingWords);
assert(filter.clean('This is a hells sadist test') === 'This is a hells sadist test');
});
});
});

0 comments on commit 4456f3a

Please sign in to comment.