Commit 2da9242d authored by Winnie Hellmann's avatar Winnie Hellmann Committed by Fatih Acet

Fix broken master in gitlab-foss (related_issuable_item_spec.js)

parent ecaede0a
...@@ -28,25 +28,32 @@ if (isESLint) { ...@@ -28,25 +28,32 @@ if (isESLint) {
testMatch = testMatch.map(path => path.replace('_spec.js', '')); testMatch = testMatch.map(path => path.replace('_spec.js', ''));
} }
// eslint-disable-next-line import/no-commonjs const moduleNameMapper = {
module.exports = {
testMatch,
moduleFileExtensions: ['js', 'json', 'vue'],
moduleNameMapper: {
'^~(/.*)$': '<rootDir>/app/assets/javascripts$1', '^~(/.*)$': '<rootDir>/app/assets/javascripts$1',
'^ee(/.*)$': '<rootDir>/ee/app/assets/javascripts$1', '^ee_component(/.*)$':
'^ee_component(/.*)$': IS_EE '<rootDir>/app/assets/javascripts/vue_shared/components/empty_component.js',
? '<rootDir>/ee/app/assets/javascripts$1' '^ee_else_ce(/.*)$': '<rootDir>/app/assets/javascripts$1',
: '<rootDir>/app/assets/javascripts/vue_shared/components/empty_component.js',
'^ee_else_ce(/.*)$': IS_EE
? '<rootDir>/ee/app/assets/javascripts$1'
: '<rootDir>/app/assets/javascripts$1',
'^helpers(/.*)$': '<rootDir>/spec/frontend/helpers$1', '^helpers(/.*)$': '<rootDir>/spec/frontend/helpers$1',
'^vendor(/.*)$': '<rootDir>/vendor/assets/javascripts$1', '^vendor(/.*)$': '<rootDir>/vendor/assets/javascripts$1',
'\\.(jpg|jpeg|png|svg)$': '<rootDir>/spec/frontend/__mocks__/file_mock.js', '\\.(jpg|jpeg|png|svg)$': '<rootDir>/spec/frontend/__mocks__/file_mock.js',
'emojis(/.*).json': '<rootDir>/fixtures/emojis$1.json', 'emojis(/.*).json': '<rootDir>/fixtures/emojis$1.json',
'^spec/test_constants$': '<rootDir>/spec/frontend/helpers/test_constants', '^spec/test_constants$': '<rootDir>/spec/frontend/helpers/test_constants',
}, };
if (IS_EE) {
const rootDirEE = '<rootDir>/ee/app/assets/javascripts$1';
Object.assign(moduleNameMapper, {
'^ee(/.*)$': rootDirEE,
'^ee_component(/.*)$': rootDirEE,
'^ee_else_ce(/.*)$': rootDirEE,
});
}
// eslint-disable-next-line import/no-commonjs
module.exports = {
testMatch,
moduleFileExtensions: ['js', 'json', 'vue'],
moduleNameMapper,
collectCoverageFrom: ['<rootDir>/app/assets/javascripts/**/*.{js,vue}'], collectCoverageFrom: ['<rootDir>/app/assets/javascripts/**/*.{js,vue}'],
coverageDirectory: '<rootDir>/coverage-frontend/', coverageDirectory: '<rootDir>/coverage-frontend/',
coverageReporters: ['json', 'lcov', 'text-summary', 'clover'], coverageReporters: ['json', 'lcov', 'text-summary', 'clover'],
......
import Vue from 'vue'; import Vue from 'vue';
import { formatDate } from '~/lib/utils/datetime_utility'; import { formatDate } from '~/lib/utils/datetime_utility';
import { mount, createLocalVue } from '@vue/test-utils'; import { mount, createLocalVue } from '@vue/test-utils';
import { PathIdSeparator } from 'ee/related_issues/constants';
import RelatedIssuableItem from '~/vue_shared/components/issue/related_issuable_item.vue'; import RelatedIssuableItem from '~/vue_shared/components/issue/related_issuable_item.vue';
import { import {
defaultAssignees, defaultAssignees,
...@@ -13,7 +12,7 @@ describe('RelatedIssuableItem', () => { ...@@ -13,7 +12,7 @@ describe('RelatedIssuableItem', () => {
const props = { const props = {
idKey: 1, idKey: 1,
displayReference: 'gitlab-org/gitlab-test#1', displayReference: 'gitlab-org/gitlab-test#1',
pathIdSeparator: PathIdSeparator.Issue, pathIdSeparator: '#',
path: `${gl.TEST_HOST}/path`, path: `${gl.TEST_HOST}/path`,
title: 'title', title: 'title',
confidential: true, confidential: true,
......
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