Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 121f649

Browse files
committed
refactor(jqLite): use the toEqualOneOf matcher in jqLite tests
1 parent dbb8483 commit 121f649

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

test/jqLiteSpec.js

+3-12
Original file line numberDiff line numberDiff line change
@@ -1026,22 +1026,13 @@ describe('jqLite', function() {
10261026
'<option>test 2</option>' +
10271027
'</select>').val()).toEqual(['test 1']);
10281028

1029-
// In jQuery >= 3.0 .val() on select[multiple] with no selected options returns an
1030-
// empty array, not null.
1031-
// See https://github.com/jquery/jquery/issues/2562 for more details.
1032-
// jqLite will align with jQuery 3.0 behavior in Angular 1.6.
1033-
var val;
1034-
if (_jqLiteMode || isJQuery2x()) {
1035-
val = null;
1036-
} else {
1037-
val = [];
1038-
}
1039-
1029+
// In jQuery < 3.0 .val() on select[multiple] with no selected options returns an
1030+
// null instead of an empty array.
10401031
expect(jqLite(
10411032
'<select multiple>' +
10421033
'<option>test 1</option>' +
10431034
'<option>test 2</option>' +
1044-
'</select>').val()).toEqual(val);
1035+
'</select>').val()).toEqualOneOf(null, []);
10451036
});
10461037
});
10471038

0 commit comments

Comments
 (0)