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:
-rw-r--r--config/webpack.config.js4
-rw-r--r--spec/javascripts/test_bundle.js19
2 files changed, 15 insertions, 8 deletions
diff --git a/config/webpack.config.js b/config/webpack.config.js
index 55122e341c3..20b3f4c0264 100644
--- a/config/webpack.config.js
+++ b/config/webpack.config.js
@@ -324,6 +324,10 @@ module.exports = {
reportFilename: path.join(ROOT_PATH, 'webpack-report/index.html'),
statsFilename: path.join(ROOT_PATH, 'webpack-report/stats.json'),
}),
+
+ new webpack.DefinePlugin({
+ 'process.env.EE': JSON.stringify(IS_EE),
+ }),
].filter(Boolean),
devServer: {
diff --git a/spec/javascripts/test_bundle.js b/spec/javascripts/test_bundle.js
index 32011375673..d736bc93d70 100644
--- a/spec/javascripts/test_bundle.js
+++ b/spec/javascripts/test_bundle.js
@@ -122,10 +122,11 @@ afterEach(() => {
const axiosDefaultAdapter = getDefaultAdapter();
// render all of our tests
-const testContexts = [
- require.context('spec', true, /_spec$/),
- require.context('ee_spec', true, /_spec$/),
-];
+const testContexts = [require.context('spec', true, /_spec$/)];
+
+if (process.env.EE) {
+ testContexts.push(require.context('ee_spec', true, /_spec$/));
+}
testContexts.forEach(context => {
context.keys().forEach(path => {
@@ -210,10 +211,12 @@ if (process.env.BABEL_ENV === 'coverage') {
];
describe('Uncovered files', function() {
- const sourceFilesContexts = [
- require.context('~', true, /\.(js|vue)$/),
- require.context('ee', true, /\.(js|vue)$/),
- ];
+ const sourceFilesContexts = [require.context('~', true, /\.(js|vue)$/)];
+
+ if (process.env.EE) {
+ sourceFilesContexts.push(require.context('ee', true, /\.(js|vue)$/));
+ }
+
const allTestFiles = testContexts.reduce(
(accumulator, context) => accumulator.concat(context.keys()),
[],