Welcome to mirror list, hosted at ThFree Co, Russian Federation.

experimentation_helper.js « __helpers__ « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c08c25155e838ea4a52762366bcab9cc5d1df65c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { merge } from 'lodash';

export function withGonExperiment(experimentKey, value = true) {
  let origGon;

  beforeEach(() => {
    origGon = window.gon;
    window.gon = merge({}, window.gon || {}, { experiments: { [experimentKey]: value } });
  });

  afterEach(() => {
    window.gon = origGon;
  });
}