Commit 2ea8ebfa authored by Winnie Hellmann's avatar Winnie Hellmann

Move EE-specifics of Karma test bundle behind flag

parent 0c6e4b4c
...@@ -324,6 +324,10 @@ module.exports = { ...@@ -324,6 +324,10 @@ module.exports = {
reportFilename: path.join(ROOT_PATH, 'webpack-report/index.html'), reportFilename: path.join(ROOT_PATH, 'webpack-report/index.html'),
statsFilename: path.join(ROOT_PATH, 'webpack-report/stats.json'), statsFilename: path.join(ROOT_PATH, 'webpack-report/stats.json'),
}), }),
new webpack.DefinePlugin({
'process.env.EE': JSON.stringify(IS_EE),
}),
].filter(Boolean), ].filter(Boolean),
devServer: { devServer: {
......
...@@ -122,10 +122,11 @@ afterEach(() => { ...@@ -122,10 +122,11 @@ afterEach(() => {
const axiosDefaultAdapter = getDefaultAdapter(); const axiosDefaultAdapter = getDefaultAdapter();
// render all of our tests // render all of our tests
const testContexts = [ const testContexts = [require.context('spec', true, /_spec$/)];
require.context('spec', true, /_spec$/),
require.context('ee_spec', true, /_spec$/), if (process.env.EE) {
]; testContexts.push(require.context('ee_spec', true, /_spec$/));
}
testContexts.forEach(context => { testContexts.forEach(context => {
context.keys().forEach(path => { context.keys().forEach(path => {
...@@ -210,10 +211,12 @@ if (process.env.BABEL_ENV === 'coverage') { ...@@ -210,10 +211,12 @@ if (process.env.BABEL_ENV === 'coverage') {
]; ];
describe('Uncovered files', function() { describe('Uncovered files', function() {
const sourceFilesContexts = [ const sourceFilesContexts = [require.context('~', true, /\.(js|vue)$/)];
require.context('~', true, /\.(js|vue)$/),
require.context('ee', true, /\.(js|vue)$/), if (process.env.EE) {
]; sourceFilesContexts.push(require.context('ee', true, /\.(js|vue)$/));
}
const allTestFiles = testContexts.reduce( const allTestFiles = testContexts.reduce(
(accumulator, context) => accumulator.concat(context.keys()), (accumulator, context) => accumulator.concat(context.keys()),
[], [],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment