}
return result;
}
+
+ function done() {
+ actual = extract( $( selector ) );
+ QUnit.push( QUnit.equiv(actual, expected), actual, expected, message );
+ }
+
+ // Get current state prior to modifier
expected = extract( $( selector ) );
- modifier( $( selector ) );
- actual = extract( $( selector ) );
- QUnit.push( QUnit.equiv(actual, expected), actual, expected, message );
+ // Run modifier (async or sync), then compare state via done()
+ if ( modifier.length ) {
+ modifier( done );
+ } else {
+ modifier();
+ done();
+ }
};
}( jQuery ));