From e47e5c5997464c17d28a7361f377f107587c5f33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Thu, 3 Nov 2016 00:09:01 +0100 Subject: [PATCH 1/4] Build: reformat package.json We can't format package.json as all other JSON/JS files since it prevents us from using npm commands updating package.json - they don't preserve the formatting. jQuery Core has switched long time ago. This commit doesn't introduce any changes to package.json except reformatting it to follow the format produced by npm. --- package.json | 156 +++++++++++++++++++++++++-------------------------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/package.json b/package.json index 175fc092..dc4aecab 100644 --- a/package.json +++ b/package.json @@ -1,80 +1,80 @@ { - "name": "jquery-migrate", - "title": "jQuery Migrate", - "description": "Migrate older jQuery code to jQuery 3.0+", - "main": "dist/jquery-migrate.js", - "version": "3.0.1-pre", - "homepage": "https://github.com/jquery/jquery-migrate", - "author": { - "name": "jQuery Foundation and other contributors", - "url": "https://github.com/jquery/jquery-migrate/blob/master/AUTHORS.txt" - }, - "repository": { - "type": "git", - "url": "git://github.com/jquery/jquery-migrate.git" - }, - "bugs": { - "url": "http://bugs.jquery.com/" - }, - "license": "MIT", - "scripts": { - "build": "grunt build", - "test": "grunt test", - "ci": "grunt ci" - }, - "peerDependencies": { - "jquery": ">=3 <4" - }, - "devDependencies": { - "chalk": "1.1.3", - "commitplease": "2.3.1", - "grunt": "0.4.5", - "grunt-cli": "0.1.13", - "grunt-contrib-concat": "1.0.1", - "grunt-contrib-jshint": "1.0.0", - "grunt-contrib-uglify": "1.0.1", - "grunt-contrib-watch": "1.0.0", - "grunt-coveralls": "1.0.1", - "grunt-git-authors": "3.2.0", - "grunt-jscs": "2.8.0", - "grunt-npmcopy": "0.1.0", - "grunt-qunit-istanbul": "0.6.0", - "jquery": "3.1.1", - "phantomjs-polyfill": "0.0.2", - "qunitjs": "1.23.1", - "testswarm": "1.1.0" - }, - "keywords": [ - "jquery", - "javascript", - "browser", - "plugin", - "migrate" - ], - "commitplease": { - "components": [ - "Docs", - "Tests", - "Build", - "Release", - "Core", - "Ajax", - "Attributes", - "Callbacks", - "CSS", - "Data", - "Deferred", - "Deprecated", - "Dimensions", - "Effects", - "Event", - "Manipulation", - "Offset", - "Queue", - "Selector", - "Serialize", - "Traversing", - "Wrap" - ] - } + "name": "jquery-migrate", + "title": "jQuery Migrate", + "description": "Migrate older jQuery code to jQuery 3.0+", + "main": "dist/jquery-migrate.js", + "version": "3.0.1-pre", + "homepage": "https://github.com/jquery/jquery-migrate", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-migrate/blob/master/AUTHORS.txt" + }, + "repository": { + "type": "git", + "url": "git://github.com/jquery/jquery-migrate.git" + }, + "bugs": { + "url": "http://bugs.jquery.com/" + }, + "license": "MIT", + "scripts": { + "build": "grunt build", + "test": "grunt test", + "ci": "grunt ci" + }, + "peerDependencies": { + "jquery": ">=3 <4" + }, + "devDependencies": { + "chalk": "1.1.3", + "commitplease": "2.3.1", + "grunt": "0.4.5", + "grunt-cli": "0.1.13", + "grunt-contrib-concat": "1.0.1", + "grunt-contrib-jshint": "1.0.0", + "grunt-contrib-uglify": "1.0.1", + "grunt-contrib-watch": "1.0.0", + "grunt-coveralls": "1.0.1", + "grunt-git-authors": "3.2.0", + "grunt-jscs": "2.8.0", + "grunt-npmcopy": "0.1.0", + "grunt-qunit-istanbul": "0.6.0", + "jquery": "3.1.1", + "phantomjs-polyfill": "0.0.2", + "qunitjs": "1.23.1", + "testswarm": "1.1.0" + }, + "keywords": [ + "jquery", + "javascript", + "browser", + "plugin", + "migrate" + ], + "commitplease": { + "components": [ + "Docs", + "Tests", + "Build", + "Release", + "Core", + "Ajax", + "Attributes", + "Callbacks", + "CSS", + "Data", + "Deferred", + "Deprecated", + "Dimensions", + "Effects", + "Event", + "Manipulation", + "Offset", + "Queue", + "Selector", + "Serialize", + "Traversing", + "Wrap" + ] + } } From 4a30cee769e6fead771f3b8c3a4ca2836b238cd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Thu, 3 Nov 2016 00:09:38 +0100 Subject: [PATCH 2/4] Build: Update commitplease and grunt-contrib-uglify --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index dc4aecab..9be4c2c2 100644 --- a/package.json +++ b/package.json @@ -27,12 +27,12 @@ }, "devDependencies": { "chalk": "1.1.3", - "commitplease": "2.3.1", + "commitplease": "2.7.5", "grunt": "0.4.5", "grunt-cli": "0.1.13", "grunt-contrib-concat": "1.0.1", "grunt-contrib-jshint": "1.0.0", - "grunt-contrib-uglify": "1.0.1", + "grunt-contrib-uglify": "2.0.0", "grunt-contrib-watch": "1.0.0", "grunt-coveralls": "1.0.1", "grunt-git-authors": "3.2.0", From 9cb1ddc0f01aeebf943f6b3ffa671f410c4f6da6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Thu, 3 Nov 2016 00:10:41 +0100 Subject: [PATCH 3/4] Build: Use load-grunt-tasks The previous way required listing all the loaded packages individually which was sub-optimal. jQuery Core also uses this package. --- Gruntfile.js | 10 +--------- package.json | 1 + 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index d7bb21d7..cfff614d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -136,15 +136,7 @@ module.exports = function( grunt ) { } ); // Load grunt tasks from NPM packages - grunt.loadNpmTasks( "grunt-git-authors" ); - grunt.loadNpmTasks( "grunt-contrib-concat" ); - grunt.loadNpmTasks( "grunt-contrib-watch" ); - grunt.loadNpmTasks( "grunt-contrib-jshint" ); - grunt.loadNpmTasks( "grunt-jscs" ); - grunt.loadNpmTasks( "grunt-contrib-uglify" ); - grunt.loadNpmTasks( "grunt-qunit-istanbul" ); - grunt.loadNpmTasks( "grunt-coveralls" ); - grunt.loadNpmTasks( "grunt-npmcopy" ); + require( "load-grunt-tasks" )( grunt ); // Integrate jQuery migrate specific tasks grunt.loadTasks( "build/tasks" ); diff --git a/package.json b/package.json index 9be4c2c2..9ca0d164 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "grunt-npmcopy": "0.1.0", "grunt-qunit-istanbul": "0.6.0", "jquery": "3.1.1", + "load-grunt-tasks": "3.5.2", "phantomjs-polyfill": "0.0.2", "qunitjs": "1.23.1", "testswarm": "1.1.0" From 1cb2093f4abd5cef29de645875dd397b7521798c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Thu, 3 Nov 2016 00:46:50 +0100 Subject: [PATCH 4/4] Build: Switch from JSHint/JSCS to ESLint Fixes #236 Closes #238 --- .eslintignore | 8 ++++ .eslintrc.json | 8 ++++ .gitignore | 8 +++- .jscsrc | 5 --- .jshintrc | 17 -------- Gruntfile.js | 64 +++++++++++++----------------- build/release.js | 14 ++++--- dist/.eslintrc.json | 8 ++++ package.json | 4 +- src/.eslintrc.json | 25 ++++++++++++ src/.jshintrc | 30 -------------- src/core.js | 4 +- src/event.js | 6 +-- src/intro.js | 9 +++-- src/migrate.js | 7 +++- src/offset.js | 2 +- src/outro.js | 2 +- test/{.jshintrc => .eslintrc.json} | 32 ++++++--------- test/deferred.js | 8 +++- test/event.js | 6 +-- test/migrate.js | 1 + test/testinit.js | 6 ++- 22 files changed, 136 insertions(+), 138 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.json delete mode 100644 .jscsrc delete mode 100644 .jshintrc create mode 100644 dist/.eslintrc.json create mode 100644 src/.eslintrc.json delete mode 100644 src/.jshintrc rename test/{.jshintrc => .eslintrc.json} (54%) diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..81fee05a --- /dev/null +++ b/.eslintignore @@ -0,0 +1,8 @@ +coverage +external +node_modules +*.min.js +src/intro.js +src/outro.js +test/data/jquery-*.js +test/data/jquery.mobile-*.js diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000..f205e806 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,8 @@ +{ + "extends": "jquery", + "root": true, + "env": { + "browser": false, + "node": true + } +} diff --git a/.gitignore b/.gitignore index 6d9469cd..8bbc353b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -dist coverage CDN .project @@ -8,4 +7,9 @@ CDN *.patch /*.html .DS_Store -node_modules \ No newline at end of file + +# Ignore everything in dist folder except for eslint config +/dist/* +!/dist/.eslintrc.json + +node_modules diff --git a/.jscsrc b/.jscsrc deleted file mode 100644 index 85ed8857..00000000 --- a/.jscsrc +++ /dev/null @@ -1,5 +0,0 @@ -"preset": "jquery" -"requireCamelCaseOrUpperCaseIdentifiers": { - "ignoreProperties": true -} -"excludeFiles": [ "external", "src/intro.js", "src/outro.js", "node_modules" ] diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 13a9e01b..00000000 --- a/.jshintrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "boss": true, - "curly": true, - "eqeqeq": true, - "eqnull": true, - "expr": true, - "immed": true, - "noarg": true, - "onevar": true, - "quotmark": "double", - "smarttabs": true, - "trailing": true, - "undef": true, - "unused": true, - - "node": true -} \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index cfff614d..684169c5 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -3,17 +3,6 @@ module.exports = function( grunt ) { "use strict"; - // The concatenated file won't pass onevar but our modules can - var readOptionalJSON = function( filepath ) { - var data = {}; - try { - data = grunt.file.readJSON( filepath ); - } catch ( e ) {} - return data; - }, - srcHintOptions = readOptionalJSON( "src/.jshintrc" ); - delete srcHintOptions.onevar; - // Project configuration. grunt.initConfig( { pkg: grunt.file.readJSON( "package.json" ), @@ -77,13 +66,24 @@ module.exports = function( grunt ) { force: true } }, - jscs: { - src: [ - "test/*.js", - "<%= files %>", - "Gruntfile.js", - "build/**/*.js" - ] + eslint: { + options: { + + // See https://github.com/sindresorhus/grunt-eslint/issues/119 + quiet: true + }, + + dist: { + src: "dist/jquery-migrate.js" + }, + dev: { + src: [ + "Gruntfile.js", + "build/**/*.js", + "src/**/*.js", + "test/**/*.js" + ] + } }, npmcopy: { all: { @@ -97,24 +97,6 @@ module.exports = function( grunt ) { "qunit/LICENSE.txt": "qunitjs/LICENSE.txt" } } }, - jshint: { - dist: { - src: [ "dist/jquery-migrate.js" ], - options: srcHintOptions - }, - tests: { - src: [ "test/*.js" ], - options: { - jshintrc: "test/.jshintrc" - } - }, - grunt: { - src: [ "Gruntfile.js" ], - options: { - jshintrc: ".jshintrc" - } - } - }, uglify: { all: { files: { @@ -144,7 +126,15 @@ module.exports = function( grunt ) { // Just an alias grunt.registerTask( "test", [ "qunit" ] ); - grunt.registerTask( "lint", [ "jshint", "jscs" ] ); + grunt.registerTask( "lint", [ + + // Running the full eslint task without breaking it down to targets + // would run the dist target first which would point to errors in the built + // file, making it harder to fix them. We want to check the built file only + // if we already know the source files pass the linter. + "eslint:dev", + "eslint:dist" + ] ); grunt.registerTask( "build", [ "concat", "uglify", "lint" ] ); grunt.registerTask( "default", [ "build", "test" ] ); diff --git a/build/release.js b/build/release.js index 3b083231..65063362 100644 --- a/build/release.js +++ b/build/release.js @@ -24,7 +24,7 @@ var releaseVersion, // Windows needs the .cmd version but will find the non-.cmd // On Windows, also ensure the HOME environment variable is set gruntCmd = process.platform === "win32" ? "grunt.cmd" : "grunt", - npmCmd = process.platform == "win32" ? "npm.cmd" : "npm", + npmCmd = process.platform === "win32" ? "npm.cmd" : "npm", readmeFile = "README.md", packageFile = "package.json", @@ -120,7 +120,7 @@ function initialize( next ) { // (look for " BRANCH pushes to BRANCH (up to date)") function checkGitStatus( next ) { - child.execFile( "git", [ "status" ], function( error, stdout, stderr ) { + child.execFile( "git", [ "status" ], function( error, stdout ) { var onBranch = ( ( stdout || "" ).match( /On branch (\S+)/ ) || [] )[ 1 ]; if ( onBranch !== branch ) { die( "Branches don't match: Wanted " + branch + ", got " + onBranch ); @@ -151,7 +151,7 @@ function updateVersions( next ) { } function gruntBuild( next ) { - exec( gruntCmd, [], function( error, stdout ) { + exec( gruntCmd, [], function( error, stdout, stderr ) { if ( error ) { die( error + stderr ); } @@ -234,7 +234,7 @@ function updateSourceVersion( ver ) { } } -function updateReadmeVersion( ver ) { +function updateReadmeVersion() { var readme = fs.readFileSync( readmeFile, "utf8" ); // Change version references from the old version to the new one. @@ -243,8 +243,10 @@ function updateReadmeVersion( ver ) { status( "Skipping " + readmeFile + " update (beta release)" ); } else { status( "Updating " + readmeFile ); - readme = readme - .replace( /jquery-migrate-\d+\.\d+\.\d+(?:-\w+)?/g, "jquery-migrate-" + releaseVersion ); + readme = readme.replace( + /jquery-migrate-\d+\.\d+\.\d+(?:-\w+)?/g, + "jquery-migrate-" + releaseVersion + ); if ( !dryrun ) { fs.writeFileSync( readmeFile, readme ); } diff --git a/dist/.eslintrc.json b/dist/.eslintrc.json new file mode 100644 index 00000000..d3814bcf --- /dev/null +++ b/dist/.eslintrc.json @@ -0,0 +1,8 @@ +{ + "extends": "../src/.eslintrc.json", + "root": true, + "rules": { + // That is okay for the built version + "no-multiple-empty-lines": "off" + } +} diff --git a/package.json b/package.json index 9ca0d164..d87ea46e 100644 --- a/package.json +++ b/package.json @@ -28,15 +28,15 @@ "devDependencies": { "chalk": "1.1.3", "commitplease": "2.7.5", + "eslint-config-jquery": "1.0.0", "grunt": "0.4.5", "grunt-cli": "0.1.13", "grunt-contrib-concat": "1.0.1", - "grunt-contrib-jshint": "1.0.0", "grunt-contrib-uglify": "2.0.0", "grunt-contrib-watch": "1.0.0", "grunt-coveralls": "1.0.1", + "grunt-eslint": "19.0.0", "grunt-git-authors": "3.2.0", - "grunt-jscs": "2.8.0", "grunt-npmcopy": "0.1.0", "grunt-qunit-istanbul": "0.6.0", "jquery": "3.1.1", diff --git a/src/.eslintrc.json b/src/.eslintrc.json new file mode 100644 index 00000000..b49d462e --- /dev/null +++ b/src/.eslintrc.json @@ -0,0 +1,25 @@ +{ + "env": { + "browser": false, + "node": false + }, + // Support: IE <=9 only, Android <=4.0 only + // The above browsers are failing a lot of tests in the ES5 + // test suite at http://test262.ecmascript.org. + "parserOptions": { + "ecmaVersion": 3 + }, + "globals": { + "window": true, + + "define": true, + "module": true, + + "jQuery": true, + "migrateWarn": true, + "migrateWarnFunc": true, + "migrateWarnProp": true, + + "noGlobal": true + } +} diff --git a/src/.jshintrc b/src/.jshintrc deleted file mode 100644 index 32798277..00000000 --- a/src/.jshintrc +++ /dev/null @@ -1,30 +0,0 @@ -{ - "boss": true, - "curly": true, - "eqeqeq": true, - "eqnull": true, - "expr": true, - "immed": true, - "noarg": true, - "onevar": true, - "quotmark": "double", - "smarttabs": true, - "trailing": true, - "undef": true, - "unused": true, - - "sub": true, - - "browser": true, - - "globals": { - "define": true, - "module": true, - - "jQuery": true, - "migrateWarn": true, - "migrateWarnProp": true, - - "noGlobal": true - } -} diff --git a/src/core.js b/src/core.js index 041b15b6..037101c1 100644 --- a/src/core.js +++ b/src/core.js @@ -29,7 +29,7 @@ jQuery.find = function( selector ) { // The nonstandard and undocumented unquoted-hash was removed in jQuery 1.12.0 // First see if qS thinks it's a valid selector, if so avoid a false positive try { - document.querySelector( selector ); + window.document.querySelector( selector ); } catch ( err1 ) { // Didn't *look* valid to qSA, warn and try quoting what we think is the value @@ -40,7 +40,7 @@ jQuery.find = function( selector ) { // If the regexp *may* have created an invalid selector, don't update it // Note that there may be false alarms if selector uses jQuery extensions try { - document.querySelector( selector ); + window.document.querySelector( selector ); migrateWarn( "Attribute selector with '#' must be quoted: " + args[ 0 ] ); args[ 0 ] = selector; } catch ( err2 ) { diff --git a/src/event.js b/src/event.js index bdb06479..5ff2fd28 100644 --- a/src/event.js +++ b/src/event.js @@ -25,7 +25,7 @@ jQuery.event.fix = function( originalEvent ) { migrateWarn( "jQuery.event.fixHooks are deprecated and removed: " + type ); if ( ( props = fixHook.props ) && props.length ) { while ( props.length ) { - jQuery.event.addProp( props.pop() ); + jQuery.event.addProp( props.pop() ); } } } @@ -67,12 +67,12 @@ jQuery.each( [ "load", "unload", "error" ], function( _, name ) { // Trigger "ready" event only once, on document ready jQuery( function() { - jQuery( document ).triggerHandler( "ready" ); + jQuery( window.document ).triggerHandler( "ready" ); } ); jQuery.event.special.ready = { setup: function() { - if ( this === document ) { + if ( this === window.document ) { migrateWarn( "'ready' event is deprecated" ); } } diff --git a/src/intro.js b/src/intro.js index 9c9d5c6e..4c7def2a 100644 --- a/src/intro.js +++ b/src/intro.js @@ -1,14 +1,17 @@ -;(function( factory ) { - /* jshint browserify:true */ +;( function( factory ) { if ( typeof define === "function" && define.amd ) { + // AMD. Register as an anonymous module. define( [ "jquery" ], window, factory ); } else if ( typeof module === "object" && module.exports ) { + // Node/CommonJS + // eslint-disable-next-line no-undef module.exports = factory( require( "jquery" ), window ); } else { + // Browser globals factory( jQuery, window ); } -}(function( jQuery, window ) { +} )( function( jQuery, window ) { "use strict"; diff --git a/src/migrate.js b/src/migrate.js index 3e30d07a..4f34fdbf 100644 --- a/src/migrate.js +++ b/src/migrate.js @@ -1,3 +1,4 @@ +/* exported migrateWarn, migrateWarnFunc, migrateWarnProp */ ( function() { @@ -5,7 +6,9 @@ // IE9 only creates console object when dev tools are first opened // Also, avoid Function#bind here to simplify PhantomJS usage var log = window.console && window.console.log && - function() { window.console.log.apply( window.console, arguments ); }, + function() { + window.console.log.apply( window.console, arguments ); + }, rbadVersions = /^[12]\./; if ( !log ) { @@ -79,7 +82,7 @@ function migrateWarnFunc( obj, prop, newFunc, msg ) { }; } -if ( document.compatMode === "BackCompat" ) { +if ( window.document.compatMode === "BackCompat" ) { // JQuery has never supported or tested Quirks Mode migrateWarn( "jQuery is not compatible with Quirks Mode" ); diff --git a/src/offset.js b/src/offset.js index 0276be08..76f4428a 100644 --- a/src/offset.js +++ b/src/offset.js @@ -11,7 +11,7 @@ jQuery.fn.offset = function() { return origin; } - docElem = ( elem.ownerDocument || document ).documentElement; + docElem = ( elem.ownerDocument || window.document ).documentElement; if ( !jQuery.contains( docElem, elem ) ) { migrateWarn( "jQuery.fn.offset() requires an element connected to a document" ); return origin; diff --git a/src/outro.js b/src/outro.js index d792ffb5..fce6396f 100644 --- a/src/outro.js +++ b/src/outro.js @@ -1,2 +1,2 @@ return jQuery; -})); +} ); diff --git a/test/.jshintrc b/test/.eslintrc.json similarity index 54% rename from test/.jshintrc rename to test/.eslintrc.json index 5ffc6dfc..72f3c933 100644 --- a/test/.jshintrc +++ b/test/.eslintrc.json @@ -1,24 +1,16 @@ { - "boss": true, - "curly": true, - "eqeqeq": true, - "eqnull": true, - "expr": true, - "immed": true, - "noarg": true, - "onevar": true, - "quotmark": "double", - "smarttabs": true, - "trailing": true, - "undef": true, - - "evil": true, - "sub": true, - - "browser": true, - "devel": true, - "wsh": true, - + "extends": "../src/.eslintrc.json", + "root": true, + "env": { + "browser": true, + "node": false + }, + // Support: IE <=9 only, Android <=4.0 only + // The above browsers are failing a lot of tests in the ES5 + // test suite at http://test262.ecmascript.org. + "parserOptions": { + "ecmaVersion": 3 + }, "globals": { "expectWarning": true, "expectNoWarning": true, diff --git a/test/deferred.js b/test/deferred.js index bf1f8c36..369a42e4 100644 --- a/test/deferred.js +++ b/test/deferred.js @@ -34,7 +34,9 @@ test( "[PIPE ONLY] jQuery.Deferred.pipe - filtering (fail)", function( assert ) piped = defer.pipe( null, function( a, b ) { return a * b; } ), - done = jQuery.map( new Array( 3 ), function() { return assert.async(); } ); + done = jQuery.map( new Array( 3 ), function() { + return assert.async(); + } ); piped.fail( function( result ) { value3 = result; @@ -100,7 +102,9 @@ test( "[PIPE ONLY] jQuery.Deferred.pipe - context", function( assert ) { var defer, piped, defer2, piped2, context = {}, - done = jQuery.map( new Array( 4 ), function() { return assert.async(); } ); + done = jQuery.map( new Array( 4 ), function() { + return assert.async(); + } ); jQuery.Deferred().resolveWith( context, [ 2 ] ).pipe( function( value ) { return value * 3; diff --git a/test/event.js b/test/event.js index 9c5f2035..27f1863d 100644 --- a/test/event.js +++ b/test/event.js @@ -98,7 +98,7 @@ test( "custom ready", function( assert ) { assert.expect( 2 ); expectNoWarning( "Custom ready event not on document", 1, function() { - jQuery( "#foo" ).on( "ready", function( e ) { + jQuery( "#foo" ).on( "ready", function() { assert.ok( true, "custom ready event was triggered" ); } ) .trigger( "ready" ) @@ -107,7 +107,7 @@ test( "custom ready", function( assert ) { } ); TestManager.runIframeTest( "document ready", "event-ready.html", - function( assert, jQuery, window, document, log ) { + function( assert, jQuery ) { assert.expect( 1 ); assert.equal( jQuery.migrateWarnings.length, 1, "warnings: " + @@ -115,7 +115,7 @@ TestManager.runIframeTest( "document ready", "event-ready.html", } ); TestManager.runIframeTest( "jQuery.event.props.concat", "event-mobile14.html", - function( assert, jQuery, window, document, log ) { + function( assert, jQuery ) { assert.expect( 1 ); var matches = jQuery.migrateWarnings.reduce( function( pv, warning ) { diff --git a/test/migrate.js b/test/migrate.js index 314fa4a6..254cb1b3 100644 --- a/test/migrate.js +++ b/test/migrate.js @@ -1,3 +1,4 @@ +/* exported expectWarning, expectNoWarning */ // Don't spew on in the console window when we build if ( navigator.userAgent.indexOf( "PhantomJS" ) >= 0 ) { diff --git a/test/testinit.js b/test/testinit.js index 229e9695..a67a9998 100644 --- a/test/testinit.js +++ b/test/testinit.js @@ -1,4 +1,5 @@ TestManager = { + /* * Load a version of a file based on URL parameters. * @@ -61,6 +62,7 @@ TestManager = { document.write( lines ); } }, + /** * Iframe tests that require setup not covered in the standard unit test * @@ -105,9 +107,9 @@ TestManager = { this.loaded = []; // Do QUnit setup if QUnit is loaded (could be an iframe page) - if ( !window.QUnit ) { + if ( !window.QUnit ) { return; - } + } // Max time for async tests until it aborts test // and start()'s the next test.