#stripHTMLTags
. For example, passing a string like 'abcdef'
does something unexpected: $('abcdef').text()
returns ""
, I guess because 'abcdef'
isn't valid html and so it just...ignores everything. At first, I fixed this by ensuring the string was always enclosed in html tags: $('<html>' + string + '</html>').text()
to ensure that in the case of no tags being present, the string is still returned. I realized that this approach ugly and probably brings up other issues. The regex, on the other hand, is very transparent in what it is doing, and easy to test as well (I'm using rubular for this because I can directly link to saved regex tests), so I chose to use it over jQuery.Also, somehow we fixed the search function bug where it would only allow one search, even though we don't know what fixed it. While it's good that it's fixed, it's worrying that seemingly unrelated functions are intertwined.
Also, I started looking at Mocha, but we ran out of time. I had a little blast of nostalgia though, because I was looking over my tests from NSFPatents2, which I wrote over the summer.
It is soooo cool that you did testing last Summer! Your college professors are going to love you, since they will be introducing so many things (like testing) to your peers for the first time, while you'll be able to say (hopefully not being too cocky about it ;-), "I've been doing that since high school."
ReplyDelete