From 4456f3ab06bb821e51d26f7800c944b5e3b9fee8 Mon Sep 17 00:00:00 2001 From: webmech Date: Tue, 23 Oct 2018 14:29:12 -0400 Subject: [PATCH] test(removeWords): update removeWords tests add test illustrating how an array should be used with the method https://github.com/web-mech/badwords/pull/45 --- test/removeWords.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/test/removeWords.js b/test/removeWords.js index 067bc84..9a0caba 100644 --- a/test/removeWords.js +++ b/test/removeWords.js @@ -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'); }); }); }); \ No newline at end of file