Browse Source

Add tests for filter() method

pull/1/merge
Luke Childs 9 years ago
parent
commit
e279b938d3
  1. 14
      test/unit.js

14
test/unit.js

@ -28,6 +28,20 @@ describe('Urls()', function() {
});
describe('.filter()', function() {
it('Should throw error if filter callback is invalid', function () {
expect(function() { Urls().filter() }).to.throw(Error);
});
it('Should filter matching urls', function () {
expect(Urls('hello url.com world').filter(function(url) {
return '<url>' + url + '</url>';
})).to.equal('hello <url>url.com</url> world');
});
});
describe('Should match', function() {
matches.forEach(function(match) {

Loading…
Cancel
Save