debian-mirror-gitlab/spec/frontend/__helpers__/experimentation_helper.js

15 lines
313 B
JavaScript
Raw Normal View History

2021-01-03 14:25:43 +05:30
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;
});
}