debian-mirror-gitlab/spec/frontend/helpers/experimentation_helper.js
2021-01-30 21:13:32 +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;
});
}