Permalink
Browse files

added tests for string.stripTags()

  • Loading branch information...
1 parent e3cfec7 commit 8614d5bbe2307277c52c0a41f56d1664e9b6bc0a @der-On der-On committed Feb 13, 2014
Showing with 10 additions and 0 deletions.
  1. +10 −0 test/string.js
View
@@ -404,6 +404,16 @@ tests = {
assert.equal(expected, data);
}
+, 'test stripTags': function () {
+ var html = '<div>foo</div><p>bar<br/>wooby</p>'
+ , expected = 'foobarwooby';
+ assert.equal(string.stripTags(html), expected);
+ }
+, 'test stripTags with allowed <br>': function () {
+ var html = '<div>foo</div><p>bar<br/>wooby</p>'
+ , expected = 'foobar<br/>wooby';
+ assert.equal(string.stripTags(html, '<br>'), expected);
+ }
};
module.exports = tests;

0 comments on commit 8614d5b

Please sign in to comment.