mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-12-12 07:25:13 +00:00
a27925152a
There seems to be no good way to enforce language on the QUnit tests. It works for the number formatting by setting the user language on the fly but for everything else it fails. I simplified some tests and skip some tests or asserts when the language is not 'en'. I also added a helper to have conditions for skipping tests. This should be part of QUnit IMO. Still I dont know if this is something we should care about at all or just assume, that devs will know what they do when they try to run tests. Change-Id: I624ccf3984434e06200abffe7ccdd25b396251af
15 lines
352 B
JavaScript
15 lines
352 B
JavaScript
( function ( $ ) {
|
|
QUnit.revisionSlider = {};
|
|
|
|
$.extend( QUnit.revisionSlider, {
|
|
// Helper function to add conditions to QUnit skip methods.
|
|
testOrSkip: function ( name, testCallback, skipCondition ) {
|
|
if ( skipCondition ) {
|
|
QUnit.skip( name, testCallback );
|
|
} else {
|
|
QUnit.test( name, testCallback );
|
|
}
|
|
}
|
|
} );
|
|
} )( jQuery );
|