mediawiki-extensions-Revisi.../tests/qunit/QUnit.revisionSlider.testOrSkip.js
WMDE-Fisch a27925152a Make QUnit tests language-setting-proof
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
2016-07-04 11:59:49 +00:00

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 );