From 2ea8ebfad5c22d53aad2df1228d97a1f53c15947 Mon Sep 17 00:00:00 2001 From: Winnie Hellmann Date: Wed, 13 Mar 2019 22:54:52 +0100 Subject: Move EE-specifics of Karma test bundle behind flag --- spec/javascripts/test_bundle.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'spec/javascripts/test_bundle.js') 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()), [], -- cgit v1.2.1