Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
a5d4c587
Commit
a5d4c587
authored
Jul 10, 2019
by
Winnie Hellmann
Committed by
Clement Ho
Jul 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workaround ESLint only resolving paths in test files
parent
863930cd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
jest.config.js
jest.config.js
+10
-1
spec/frontend/error_tracking_settings/mock.js
spec/frontend/error_tracking_settings/mock.js
+1
-1
No files found.
jest.config.js
View file @
a5d4c587
...
...
@@ -15,9 +15,18 @@ if (process.env.CI) {
]);
}
let
testMatch
=
[
'
<rootDir>/spec/frontend/**/*_spec.js
'
,
'
<rootDir>/ee/spec/frontend/**/*_spec.js
'
];
// workaround for eslint-import-resolver-jest only resolving in test files
// see https://github.com/JoinColony/eslint-import-resolver-jest#note
const
isESLint
=
module
.
parent
.
path
.
includes
(
'
/eslint-import-resolver-jest/
'
);
if
(
isESLint
)
{
testMatch
=
testMatch
.
map
(
path
=>
path
.
replace
(
'
_spec.js
'
,
''
));
}
// eslint-disable-next-line import/no-commonjs
module
.
exports
=
{
testMatch
:
[
'
<rootDir>/spec/frontend/**/*_spec.js
'
,
'
<rootDir>/ee/spec/frontend/**/*_spec.js
'
]
,
testMatch
,
moduleFileExtensions
:
[
'
js
'
,
'
json
'
,
'
vue
'
],
moduleNameMapper
:
{
'
^~(/.*)$
'
:
'
<rootDir>/app/assets/javascripts$1
'
,
...
...
spec/frontend/error_tracking_settings/mock.js
View file @
a5d4c587
import
createStore
from
'
~/error_tracking_settings/store
'
;
import
{
TEST_HOST
}
from
'
../
helpers/test_constants
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
const
defaultStore
=
createStore
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment