Skip to content

Commit 55d3c63

Browse files
committed
Skip the nested data test on unsupposed browsers
The nested data attributes are only supported on jQuery 2.x or browsers which support the `dataset` attributes on DOM elements. In order to prevent test failures, and because tests cannot yet be skipped conditionally, we just cut the test early.
1 parent 992652b commit 55d3c63

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ The license is available within the repository in the [LICENSE][license] file.
9797
[select2-rails]: https://github.com/argerim/select2-rails
9898
[symfony-select2]: https://github.com/19Gerhard85/sfSelect2WidgetsPlugin
9999
[symfony2-select2]: https://github.com/avocode/FormExtensions
100-
[travis-ci-image]: https://travis-ci.org/select2/select2.svg?branch=select2-ng
100+
[travis-ci-image]: https://travis-ci.org/select2/select2.svg?branch=master
101101
[travis-ci-status]: https://travis-ci.org/select2/select2
102102
[wicket]: http://wicket.apache.org
103103
[wicket-select2]: https://github.com/ivaynberg/wicket-select2

tests/options/data-tests.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ test('no nesting', function (assert) {
1515
test('with nesting', function (assert) {
1616
var $test = $('<select data-first--second="test"></select>');
1717

18+
if ($test[0].dataset == null) {
19+
assert.ok(
20+
true,
21+
'We can not run this test with jQuery 1.x if dataset is not implemented'
22+
);
23+
24+
return;
25+
}
26+
1827
var options = new Options({}, $test);
1928

2029
assert.ok(!(options.get('first-Second')));

0 commit comments

Comments
 (0)