summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Ho <clemmakesapps@gmail.com>2018-03-02 17:18:29 +0000
committerClement Ho <clemmakesapps@gmail.com>2018-03-02 17:18:29 +0000
commit98fecb5f8e64c4c64c96d065bc342d986140367e (patch)
tree56ec4b668a55db09c30c87bb993e293c22585c6c
parente17d8ad8476148daedb6dcb3c0c7aee2db4db60d (diff)
parenteefd17437c201418b7336493eb320a129a5b8abe (diff)
downloadgitlab-ce-98fecb5f8e64c4c64c96d065bc342d986140367e.tar.gz
Merge branch 'remove-test-bundle' into 'master'
Remove the "test" bundle and apply it conditionally within main.js See merge request gitlab-org/gitlab-ce!17472
-rw-r--r--app/assets/javascripts/main.js7
-rw-r--r--app/assets/javascripts/test.js1
-rw-r--r--app/views/layouts/_head.html.haml1
-rw-r--r--config/webpack.config.js1
4 files changed, 5 insertions, 5 deletions
diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js
index 659dc9eaa1f..53b01cca1d3 100644
--- a/app/assets/javascripts/main.js
+++ b/app/assets/javascripts/main.js
@@ -36,8 +36,11 @@ import initBreadcrumbs from './breadcrumb';
import initDispatcher from './dispatcher';
-// eslint-disable-next-line global-require, import/no-commonjs
-if (process.env.NODE_ENV !== 'production') require('./test_utils/');
+// inject test utilities if necessary
+if (process.env.NODE_ENV !== 'production' && gon && gon.test_env) {
+ $.fx.off = true;
+ import(/* webpackMode: "eager" */ './test_utils/');
+}
svg4everybody();
diff --git a/app/assets/javascripts/test.js b/app/assets/javascripts/test.js
deleted file mode 100644
index c4c7918a68f..00000000000
--- a/app/assets/javascripts/test.js
+++ /dev/null
@@ -1 +0,0 @@
-$.fx.off = true;
diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml
index 0c979109b3f..b981b5fdafa 100644
--- a/app/views/layouts/_head.html.haml
+++ b/app/views/layouts/_head.html.haml
@@ -42,7 +42,6 @@
= webpack_bundle_tag "common"
= webpack_bundle_tag "main"
= webpack_bundle_tag "raven" if Gitlab::CurrentSettings.clientside_sentry_enabled
- = webpack_bundle_tag "test" if Rails.env.test?
- if content_for?(:page_specific_javascripts)
= yield :page_specific_javascripts
diff --git a/config/webpack.config.js b/config/webpack.config.js
index 9dd3cd401de..959cebe7487 100644
--- a/config/webpack.config.js
+++ b/config/webpack.config.js
@@ -53,7 +53,6 @@ function generateEntries() {
main: './main.js',
ide: './ide/index.js',
raven: './raven/index.js',
- test: './test.js',
webpack_runtime: './webpack.js',
};