Closure compiler tests #845

Closed
wants to merge 16 commits into
from

4 participants

@ChadKillingsworth

Update the unit tests to be compatible with Closure-Compiler.

@rwaldron rwaldron commented on an outdated diff Jun 30, 2012
test/unit/core.js
@@ -797,7 +800,7 @@ test("map()", function() {
var keys, values, scripts, nonsense, mapped, flat;
//for #2616
- keys = jQuery.map( {a:1,b:2}, function( v, k ){
+ var keys = jQuery.map( {"a":1,"b":2}, function( v, k ){
return k;
@rwaldron
jQuery Foundation member
rwaldron added a line comment Jun 30, 2012

keys is already declared, but not assigned, please remove the var

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@rwaldron
jQuery Foundation member

While reviewing this PR, I discovered a typo in our grunt task for linting the tests, I've fixed this in the master branch -- this has revealed a number of issues that need to be addressed. Can you rebase and run grunt? There will be a lot of is better written in dot notation. errors, please ignore those for now, we'll come up with a solution for those - however any other lint issues need to be resolved.

@mikesherov
jQuery Foundation member

@rwldrn, @ChadKillingsworth: regarding is better written in dot notation., just add sub: true to the unit test .jshintrc file.

@ChadKillingsworth

I can get this fixed shortly. I didn't realize that jshint was running against the unit tests now, but that would definitely explain why they look so much better now.

I'm currently fighting with grunt - it's choking at the "compare_size:files" task. As soon as I get that straightened out I'll have an update.

@ChadKillingsworth

I've fixed my grunt issues. However, now it is reporting no lint errors. I can make jshint violations in the src files and then grunt will report an error, but I have yet to get one reported for errors in unit tests.

Running "lint:tests" (lint) task
Lint free.
@ChadKillingsworth

Got it working. All the jshint errors have been corrected (included adding the sub: true option to the test/.jshintrc file).

@dmethvin dmethvin added a commit that closed this pull request Jul 5, 2012
@ChadKillingsworth ChadKillingsworth Make unit tests friendly to Closure Compiler. Closes gh-845.
    Conflicts:
    	test/unit/effects.js
    	test/unit/offset.js
de9bed3
@dmethvin dmethvin closed this in de9bed3 Jul 5, 2012
@mescoda mescoda pushed a commit to mescoda/jquery that referenced this pull request Nov 4, 2014
@ChadKillingsworth ChadKillingsworth Make unit tests friendly to Closure Compiler. Closes gh-845.
    Conflicts:
    	test/unit/effects.js
    	test/unit/offset.js
601547c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment