Skip to content

Commit

Permalink
isProgressing becomes isPending. Unit tests added.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaubourg committed Oct 4, 2011
1 parent 11b7614 commit 749d32a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/deferred.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jQuery.extend({

isResolved: doneList.fired,
isRejected: failList.fired,
isProgressing: function() {
isPending: function() {
return !progressList.locked();
},

Expand Down
5 changes: 4 additions & 1 deletion test/unit/deferred.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jQuery.each( [ "", " - new operator" ], function( _, withNew ) {

test("jQuery.Deferred" + withNew, function() {

expect( 14 );
expect( 20 );

createDeferred().resolve().then( function() {
ok( true , "Success on resolve" );
Expand Down Expand Up @@ -37,14 +37,17 @@ jQuery.each( [ "", " - new operator" ], function( _, withNew ) {

jQuery.each( "resolve reject".split( " " ), function( _, change ) {
createDeferred( function( defer ) {
ok( defer.isPending(), "pending after creation" );
var checked = 0;
defer.progress(function( value ) {
strictEqual( value, checked, "Progress: right value (" + value + ") received" );
});
for( checked = 0; checked < 3 ; checked++ ) {
defer.notify( checked );
}
ok( defer.isPending(), "pending after notification" );
defer[ change ]();
ok( !defer.isPending(), "not pending after " + change );
defer.notify();
});
});
Expand Down

0 comments on commit 749d32a

Please sign in to comment.