3 var getBucket
= mw
.experiments
.getBucket
;
5 function createExperiment() {
18 QUnit
.module( 'mediawiki.experiments' );
20 QUnit
.test( 'getBucket( experiment, token )', 4, function ( assert
) {
21 var experiment
= createExperiment(),
25 getBucket( experiment
, token
),
26 getBucket( experiment
, token
),
27 'It returns the same bucket for the same experiment-token pair.'
31 experiment
= createExperiment();
32 experiment
.buckets
= {
38 getBucket( experiment
, token
),
39 'It returns the bucket if only one is defined.'
43 experiment
= createExperiment();
44 experiment
.enabled
= false;
48 getBucket( experiment
, token
),
49 'It returns "control" if the experiment is disabled.'
53 experiment
= createExperiment();
54 experiment
.buckets
= {};
58 getBucket( experiment
, token
),
59 'It returns "control" if the experiment doesn\'t have any buckets.'