debian-mirror-gitlab/spec/frontend/helpers/experimentation_helper.js
2021-01-03 14:25:43 +05:30

14 lines
313 B
JavaScript

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