Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2019-03-13 02:29:08 +0300
committerWinnie Hellmann <winnie@gitlab.com>2019-03-13 02:29:08 +0300
commit4a5eedb1757aed21e815323356ef67ae614526d2 (patch)
tree1bba3f55497e04c22cc8aff26fc8fe597b76155a /config/karma.config.js
parenta89df58527aae693438001ab0800363e7a7d6b07 (diff)
Hide 404 errors in Karma locally
Diffstat (limited to 'config/karma.config.js')
-rw-r--r--config/karma.config.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/config/karma.config.js b/config/karma.config.js
index e1d7c30b1c2..746c11ebd64 100644
--- a/config/karma.config.js
+++ b/config/karma.config.js
@@ -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') {