From 48d3739bf33e4db50e4e29928e287bbbe0a67934 Mon Sep 17 00:00:00 2001 From: Keen Yee Liau Date: Tue, 3 Jul 2018 09:24:00 -0700 Subject: [PATCH] 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 --- types/karma/index.d.ts | 12 ++++++++++++ types/karma/karma-tests.ts | 2 ++ 2 files changed, 14 insertions(+) diff --git a/types/karma/index.d.ts b/types/karma/index.d.ts index e2cce2c340..682cb35bf2 100644 --- a/types/karma/index.d.ts +++ b/types/karma/index.d.ts @@ -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. diff --git a/types/karma/karma-tests.ts b/types/karma/karma-tests.ts index b21fa88e50..6d9b8abd9f 100644 --- a/types/karma/karma-tests.ts +++ b/types/karma/karma-tests.ts @@ -88,6 +88,8 @@ module.exports = function(config: karma.Config) { 'coverage' ], + middleware: ['foo', 'bar'], + mime: { 'text/x-typescript': ['ts', 'tsx'] },