summaryrefslogtreecommitdiff
path: root/spec/frontend/environment.js
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2019-03-28 13:38:29 +0100
committerWinnie Hellmann <winnie@gitlab.com>2019-03-28 18:17:10 +0100
commit63f6fcd0b7876b74f7d42f3c787a8fdb53a264e2 (patch)
treec7d9221300efb0bd942266f28dbe99a90b080707 /spec/frontend/environment.js
parent5a2d7bf245aea165a2569916e8419e76c5715fda (diff)
downloadgitlab-ce-63f6fcd0b7876b74f7d42f3c787a8fdb53a264e2.tar.gz
Set gon.ee in Jestwinh-jest-gon
Diffstat (limited to 'spec/frontend/environment.js')
-rw-r--r--spec/frontend/environment.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/frontend/environment.js b/spec/frontend/environment.js
index cb128c7d880..1067a53906a 100644
--- a/spec/frontend/environment.js
+++ b/spec/frontend/environment.js
@@ -6,6 +6,7 @@ const JSDOMEnvironment = require('jest-environment-jsdom');
class CustomEnvironment extends JSDOMEnvironment {
constructor(config, context) {
super(config, context);
+
Object.assign(context.console, {
error(...args) {
throw new ErrorWithStack(
@@ -21,6 +22,11 @@ class CustomEnvironment extends JSDOMEnvironment {
);
},
});
+
+ const { testEnvironmentOptions } = config;
+ this.global.gon = {
+ ee: testEnvironmentOptions.IS_EE,
+ };
}
}