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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/environment.js')
-rw-r--r--spec/frontend/environment.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/frontend/environment.js b/spec/frontend/environment.js
index d1bc11538a3..29aa416149c 100644
--- a/spec/frontend/environment.js
+++ b/spec/frontend/environment.js
@@ -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) => {
@@ -67,6 +70,24 @@ class CustomEnvironment extends JSDOMEnvironment {
getEntriesByName: () => [],
});
+ //
+ // Monaco-related environment variables
+ //
+ this.global.MonacoEnvironment = { globalAPI: true };
+ Object.defineProperty(this.global, 'matchMedia', {
+ writable: true,
+ value: (query) => ({
+ matches: false,
+ media: query,
+ onchange: null,
+ addListener: () => null, // deprecated
+ removeListener: () => null, // deprecated
+ addEventListener: () => null,
+ removeEventListener: () => null,
+ dispatchEvent: () => null,
+ }),
+ });
+
this.global.PerformanceObserver = class {
/* eslint-disable no-useless-constructor, no-unused-vars, no-empty-function, class-methods-use-this */
constructor(callback) {}