Commit a2cc495c authored by Phil Hughes's avatar Phil Hughes

Merge branch 'winh-single-test-bundle-ee' into 'master'

Resolve differences in Karma test bundle between CE and EE (EE-port)

See merge request gitlab-org/gitlab-ee!10036
parents 52b6bd8b 67746922
......@@ -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: {
......
......@@ -69,7 +69,7 @@ window.gl = window.gl || {};
window.gl.TEST_HOST = TEST_HOST;
window.gon = window.gon || {};
window.gon.test_env = true;
window.gon.ee = false;
window.gon.ee = process.env.EE;
gon.relative_url_root = '';
let hasUnhandledPromiseRejections = false;
......@@ -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()),
[],
......
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