diff options
author | Winnie Hellmann <winnie@gitlab.com> | 2019-03-13 22:54:52 +0100 |
---|---|---|
committer | Winnie Hellmann <winnie@gitlab.com> | 2019-03-13 22:54:52 +0100 |
commit | 2ea8ebfad5c22d53aad2df1228d97a1f53c15947 (patch) | |
tree | d1bcf543eac8c01879eb934a679cdaf49d24cd28 /spec/javascripts/test_bundle.js | |
parent | 0c6e4b4c728c32923f1090eaf9927d84d7e78e36 (diff) | |
download | gitlab-ce-2ea8ebfad5c22d53aad2df1228d97a1f53c15947.tar.gz |
Move EE-specifics of Karma test bundle behind flag
Diffstat (limited to 'spec/javascripts/test_bundle.js')
-rw-r--r-- | spec/javascripts/test_bundle.js | 19 |
1 files changed, 11 insertions, 8 deletions
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()), [], |