tooltip:'Only load tests from this MediaWiki component',
value:values
});
// Integrate SinonJS with QUnit
//
// - Add a Sinon sandbox to the test context that is automatically
// restored at the end of each test.
// - Forward sinon assertions to QUnit.
//
// Inspired by http://sinonjs.org/releases/sinon-qunit-1.0.0.js
sinon.assert.fail=function(msg){
QUnit.assert.true(false,msg);
};
sinon.assert.pass=function(msg){
QUnit.assert.true(true,msg);
};
functioncreateStubLegacy(obj,method,fn){
if(arguments.length>2){
if(typeoffn==='function'){
returnsinon.stub(obj,method).callsFake(fn);
}else{
returnsinon.replace(obj,method,fn);
}
}else{
returnsinon.stub.apply(null,arguments);
}
}
// eslint-disable-next-line no-unused-vars
functioncreateSpyLegacy(object,property,types){
constspy=sinon.spy.apply(null,arguments);
spy.reset=spy.resetHistory;
returnspy;
}
QUnit.hooks.beforeEach(function(){
// Sinon sandbox
sinon.createSandbox({
injectInto:this,
properties:['spy','stub','mock','sandbox'],
// Don't fake timers by default
useFakeTimers:false,
useFakeServer:false
});
this.sandbox.stub=this.stub=createStubLegacy;
this.sandbox.spy=this.spy=createSpyLegacy;
constuseFakeTimers=this.sandbox.useFakeTimers;
this.sandbox.useFakeTimers=function(now){
if(arguments.length>1){
// eslint-disable-next-line no-console
console.warn(newError('Use of `sinon.useFakeTimers(now, prop)` is deprecated, use `sinon.useFakeTimers(now)` or `sinon.useFakeTimers( { now, toFake } )` instead (T239271).'));