1 module( 'jquery.highlightText' );
3 test( '-- Initial check', function() {
5 ok( $.fn
.highlightText
, 'jQuery.fn.highlightText defined' );
8 test( 'Check', function() {
11 text
: 'Blue Öyster Cult',
13 expected
: '<span class="highlight">Blue</span> Öyster Cult'
17 highlight
: 'Österreich',
18 expected
: '<span class="highlight">Österreich</span>'
21 desc
: 'Highlighter broken on punctuation mark',
22 text
: 'So good. To be there',
24 expected
: 'So <span class="highlight">good</span>. To be there'
30 $.each(cases
, function( i
, item
) {
31 $fixture
= $( '<p></p>' ).text( item
.text
);
32 $fixture
.highlightText( item
.highlight
);
35 $('<p>' + item
.expected
+ '</p>').html(), // re-parse to normalize!
36 item
.desc
|| undefined