Commit e20771af authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch '335482-follow-up-from-enable-user-setting-for-absolute-dates' into 'master'

Remove timeago methods exposed on window object

See merge request gitlab-org/gitlab!65734
parents 23cce101 304f28cb
......@@ -133,10 +133,3 @@ export const timeFor = (time, expiredLabel) => {
}
return timeago.format(time, `${timeagoLanguageCode}-remaining`).trim();
};
window.timeago = getTimeago();
window.gl = window.gl || {};
window.gl.utils = {
...(window.gl.utils || {}),
localTimeAgo,
};
......@@ -46,6 +46,9 @@ applyGitLabUIConfig();
window.jQuery = jQuery;
window.$ = jQuery;
// ensure that window.gl is set up
window.gl = window.gl || {};
// inject test utilities if necessary
if (process.env.NODE_ENV !== 'production' && gon?.test_env) {
import(/* webpackMode: "eager" */ './test_utils/');
......
......@@ -43,6 +43,9 @@ class CustomEnvironment extends JSDOMEnvironment {
};
this.global.IS_EE = IS_EE;
// Set up global `gl` object
this.global.gl = {};
this.rejectedPromises = [];
this.global.promiseRejectionHandler = (error) => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment