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
Léo-Paul Géneau
gitlab-ce
Commits
4a5eedb1
Commit
4a5eedb1
authored
Mar 13, 2019
by
Winnie Hellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide 404 errors in Karma locally
parent
a89df585
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
config/karma.config.js
config/karma.config.js
+22
-0
No files found.
config/karma.config.js
View file @
4a5eedb1
...
...
@@ -115,6 +115,15 @@ module.exports = function(config) {
reporters
:
[
'
progress
'
],
webpack
:
webpackConfig
,
webpackMiddleware
:
{
stats
:
'
errors-only
'
},
plugins
:
[
'
karma-chrome-launcher
'
,
'
karma-coverage-istanbul-reporter
'
,
'
karma-jasmine
'
,
'
karma-junit-reporter
'
,
'
karma-mocha-reporter
'
,
'
karma-sourcemap-loader
'
,
'
karma-webpack
'
,
],
};
if
(
process
.
env
.
CI
)
{
...
...
@@ -123,6 +132,19 @@ module.exports = function(config) {
outputFile
:
'
junit_karma.xml
'
,
useBrowserName
:
false
,
};
}
else
{
// ignore 404s in local environment because we are not fixing them and they bloat the log
function
ignore404
()
{
return
(
request
,
response
/* next */
)
=>
{
response
.
writeHead
(
404
);
return
response
.
end
(
'
NOT FOUND
'
);
};
}
karmaConfig
.
middleware
=
[
'
ignore-404
'
];
karmaConfig
.
plugins
.
push
({
'
middleware:ignore-404
'
:
[
'
factory
'
,
ignore404
],
});
}
if
(
process
.
env
.
BABEL_ENV
===
'
coverage
'
||
process
.
env
.
NODE_ENV
===
'
coverage
'
)
{
...
...
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