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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
99f98755
Commit
99f98755
authored
Sep 27, 2021
by
Albert Salim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update eslintrc to ignore generated file imports
parent
ff4773d4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
7 deletions
+18
-7
jest_resolver.js
jest_resolver.js
+10
-2
spec/frontend/.eslintrc.yml
spec/frontend/.eslintrc.yml
+6
-1
spec/frontend/deploy_freeze/helpers.js
spec/frontend/deploy_freeze/helpers.js
+1
-1
spec/frontend_integration/test_helpers/mock_server/graphql.js
.../frontend_integration/test_helpers/mock_server/graphql.js
+1
-3
No files found.
jest_resolver.js
View file @
99f98755
/* eslint-disable import/no-commonjs */
/* eslint-disable import/no-extraneous-dependencies */
const
Resolver
=
require
(
'
jest-resolve
'
);
// Wrap jest default resolver to detect missing frontend fixtures.
module
.
exports
=
(
request
,
options
)
=>
{
try
{
return
options
.
defaultResolver
(
request
,
options
)
return
options
.
defaultResolver
(
request
,
options
)
;
}
catch
(
e
)
{
if
(
Resolver
.
tryCastModuleNotFoundError
(
e
)
&&
request
.
match
(
/tmp
\/
tests
\/
frontend
\/
fixtures/
))
{
console
.
error
(
'
\
x1b[1m
\
x1b[41m
\
x1b[30m %s
\
x1b[0m %s
'
,
'
!
'
,
`Fixture file
${
request
}
does not exist. Did you run bin/rake frontend:fixtures?`
)
/* eslint-disable no-console */
/* eslint-disable @gitlab/require-i18n-strings */
console
.
error
(
'
\
x1b[1m
\
x1b[41m
\
x1b[30m %s
\
x1b[0m %s
'
,
'
!
'
,
`Fixture file
${
request
}
does not exist. Did you run bin/rake frontend:fixtures?`
,
);
}
throw
e
;
}
...
...
spec/frontend/.eslintrc.yml
View file @
99f98755
...
...
@@ -26,4 +26,9 @@ rules:
-
off
"
@gitlab/no-global-event-off"
:
-
off
import/no-unresolved
:
-
error
# The test fixtures and graphql schema are dynamically generated in CI
# during the `frontend-fixtures` and `graphql-schema-dump` jobs.
# They may not be present during linting.
-
ignore
:
[
'
^test_fixtures\/'
,
'
tmp/tests/graphql/gitlab_schema.graphql'
]
spec/frontend/deploy_freeze/helpers.js
View file @
99f98755
import
{
secondsToHours
}
from
'
~/lib/utils/datetime_utility
'
;
import
freezePeriodsFixture
from
'
test_fixtures/api/freeze-periods/freeze_periods.json
'
;
import
timezoneDataFixture
from
'
test_fixtures/timezones/short.json
'
;
import
{
secondsToHours
}
from
'
~/lib/utils/datetime_utility
'
;
export
{
freezePeriodsFixture
,
timezoneDataFixture
};
...
...
spec/frontend_integration/test_helpers/mock_server/graphql.js
View file @
99f98755
import
{
buildSchema
,
graphql
}
from
'
graphql
'
;
import
{
memoize
}
from
'
lodash
'
;
// The graphql schema is dynamically generated in CI
// during the `graphql-schema-dump` job.
// eslint-disable-next-line global-require, import/no-unresolved
// eslint-disable-next-line global-require
const
getGraphqlSchema
=
()
=>
require
(
'
../../../../tmp/tests/graphql/gitlab_schema.graphql
'
);
const
graphqlResolvers
=
{
...
...
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