resources: Strip '$' and 'mw' from file closures
[lhc/web/wiklou.git] / tests / qunit / suites / resources / jquery / jquery.textSelection.test.js
index 3ab8428..4966747 100644 (file)
@@ -1,4 +1,28 @@
-( function ( $ ) {
+( function () {
+       var caretSample,
+               sig = {
+                       pre: '--~~~~'
+               },
+               bold = {
+                       pre: '\'\'\'',
+                       peri: 'Bold text',
+                       post: '\'\'\''
+               },
+               h2 = {
+                       pre: '== ',
+                       peri: 'Heading 2',
+                       post: ' ==',
+                       regex: /^(\s*)(={1,6})(.*?)\2(\s*)$/,
+                       regexReplace: '$1==$3==$4',
+                       ownline: true
+               },
+               ulist = {
+                       pre: '* ',
+                       peri: 'Bulleted list item',
+                       post: '',
+                       ownline: true,
+                       splitlines: true
+               };
 
        QUnit.module( 'jquery.textSelection', QUnit.newMwEnvironment() );
 
 
                        text = $textarea.textSelection( 'getContents' ).replace( /\r\n/g, '\n' );
 
-                       assert.equal( text, opt.after.text, 'Checking full text after encapsulation' );
+                       assert.strictEqual( text, opt.after.text, 'Checking full text after encapsulation' );
 
                        if ( opt.after.selected !== null ) {
                                selected = $textarea.textSelection( 'getSelection' );
-                               assert.equal( selected, opt.after.selected, 'Checking selected text after encapsulation.' );
+                               assert.strictEqual( selected, opt.after.selected, 'Checking selected text after encapsulation.' );
                        }
 
                } );
        }
 
-       var caretSample,
-               sig = {
-                       pre: '--~~~~'
-               },
-               bold = {
-                       pre: '\'\'\'',
-                       peri: 'Bold text',
-                       post: '\'\'\''
-               },
-               h2 = {
-                       pre: '== ',
-                       peri: 'Heading 2',
-                       post: ' ==',
-                       regex: /^(\s*)(={1,6})(.*?)\2(\s*)$/,
-                       regexReplace: '$1==$3==$4',
-                       ownline: true
-               },
-               ulist = {
-                       pre: '* ',
-                       peri: 'Bulleted list item',
-                       post: '',
-                       ownline: true,
-                       splitlines: true
-               };
-
        encapsulateTest( {
                description: 'Adding sig to end of text',
                before: {
                        }
 
                        function among( actual, expected, message ) {
-                               if ( $.isArray( expected ) ) {
-                                       assert.ok( $.inArray( actual, expected ) !== -1, message + ' (got ' + actual + '; expected one of ' + expected.join( ', ' ) + ')' );
+                               if ( Array.isArray( expected ) ) {
+                                       assert.strictEqual( expected.indexOf( actual ) !== -1, true, message + ' (got ' + actual + '; expected one of ' + expected.join( ', ' ) + ')' );
                                } else {
-                                       assert.equal( actual, expected, message );
+                                       assert.strictEqual( actual, expected, message );
                                }
                        }
 
                end: 11,
                mode: 'set'
        } );
-}( jQuery ) );
+}() );