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

versions_menu_helper.js « helpers « components « default « frontend « spec - gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bdc1fa8801ec40e03d73056cea9561ffd521ec74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/**
 * Creates a mock browser window object with a given path.
 * @param {String} pathname
 */
export const setWindowPath = (pathname) => {
  const location = {
    ...window.location,
    pathname,
  };
  Object.defineProperty(window, 'location', {
    writable: true,
    value: location,
  });
};