Load EE fixtures from ee/ directory in Karma

(cherry picked from commit 7cde57bf7367bce130a2e7f149c8dafd362de3f8)
This commit is contained in:
Winnie Hellmann 2019-04-25 11:48:54 +02:00
parent 1542904541
commit 6e3165f0b4
2 changed files with 7 additions and 2 deletions

View file

@ -4,6 +4,7 @@ const chalk = require('chalk');
const webpack = require('webpack');
const argumentsParser = require('commander');
const webpackConfig = require('./webpack.config.js');
const IS_EE = require('./helpers/is_ee_env');
const ROOT_PATH = path.resolve(__dirname, '..');
const SPECS_PATH = /^(?:\.[\\\/])?(ee[\\\/])?spec[\\\/]javascripts[\\\/]/;
@ -90,6 +91,8 @@ if (specFilters.length) {
module.exports = function(config) {
process.env.TZ = 'Etc/UTC';
const fixturesPath = `${IS_EE ? 'ee/' : ''}spec/javascripts/fixtures`;
const karmaConfig = {
basePath: ROOT_PATH,
browsers: ['ChromeHeadlessCustom'],
@ -110,7 +113,7 @@ module.exports = function(config) {
frameworks: ['jasmine'],
files: [
{ pattern: 'spec/javascripts/test_bundle.js', watched: false },
{ pattern: `spec/javascripts/fixtures/**/*@(.json|.html|.png|.bmpr|.pdf)`, included: false },
{ pattern: `${fixturesPath}/**/*@(.json|.html|.png|.bmpr|.pdf)`, included: false },
],
preprocessors: {
'spec/javascripts/**/*.js': ['webpack', 'sourcemap'],

View file

@ -1,4 +1,6 @@
export const FIXTURES_PATH = '/base/spec/javascripts/fixtures';
export const FIXTURES_PATH = `/base/${
process.env.IS_GITLAB_EE ? 'ee/' : ''
}spec/javascripts/fixtures`;
export const TEST_HOST = 'http://test.host';
export const DUMMY_IMAGE_URL = `${FIXTURES_PATH}/static/images/one_white_pixel.png`;