GorkemsCafe/node_modules/bad-words/test/options.js
2023-09-28 18:03:39 +03:00

25 lines
697 B
JavaScript

require('assert');
var Filter = require('../lib/badwords.js'),
assert = require('better-assert');
describe('options', function() {
describe('split regex', function() {
it('default value', function() {
filter = new Filter();
filter.addWords('français');
assert(filter.clean('fucking asshole') == '******* *******');
assert(filter.clean('mot en français') == 'mot en français');
});
it('override value', function() {
filter = new Filter({splitRegex: / /});
filter.addWords('français');
assert(filter.clean('fucking asshole') == '******* *******');
assert(filter.clean('mot en français') == 'mot en *******');
});
});
});