karma: Add typings for 'middleware' in ConfigOptions (#26882)

Karma config accepts a list of middleware as documented here:
http://karma-runner.github.io/2.0/config/configuration-file.html
This commit is contained in:
Keen Yee Liau
2018-07-03 09:24:00 -07:00
committed by Mohamed Hegazy
parent bc4d86eeab
commit 48d3739bf3
2 changed files with 14 additions and 0 deletions

View File

@@ -294,6 +294,18 @@ declare namespace karma {
* @description A list of log appenders to be used. See the documentation for [log4js] for more information.
*/
loggers?: Log4jsAppenderConfigBase[];
/**
* @default []
* @description List of names of additional middleware you want the
* Karma server to use. Middleware will be used in the order listed.
* You must have installed the middleware via a plugin/framework
* (either inline or via NPM). Additional information can be found in
* [plugins](http://karma-runner.github.io/2.0/config/plugins.html).
* The plugin must provide an express/connect middleware function
* (details about this can be found in the
* [Express](http://expressjs.com/guide/using-middleware.html) docs).
*/
middleware?: string[];
/**
* @default {}
* @description Redefine default mapping from file extensions to MIME-type.

View File

@@ -88,6 +88,8 @@ module.exports = function(config: karma.Config) {
'coverage'
],
middleware: ['foo', 'bar'],
mime: {
'text/x-typescript': ['ts', 'tsx']
},