mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 07:17:04 +00:00
Add type definitions for karma-webpack (#20140)
This commit is contained in:
committed by
Ryan Cavanaugh
parent
4603024201
commit
d21b17c876
Vendored
+38
@@ -0,0 +1,38 @@
|
||||
// Type definitions for karma-webpack 2.0
|
||||
// Project: http://github.com/webpack/karma-webpack
|
||||
// Definitions by: Matt Traynham <https://github.com/mtraynham>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import * as m from 'karma';
|
||||
import webpack = require('webpack');
|
||||
import webpackDevMiddleware = require('webpack-dev-middleware');
|
||||
|
||||
declare module 'karma' {
|
||||
// Note: karma-webpack will set publicPath for us, so it is optional here.
|
||||
// Unfortuantely, Typescript doesn't let you overload properties, so
|
||||
// the entire definition is duplicated here.
|
||||
interface KarmaWebpackMiddlewareOptions /** extends webpackDevMiddleware.Options */ {
|
||||
noInfo?: boolean;
|
||||
quiet?: boolean;
|
||||
lazy?: boolean;
|
||||
watchOptions?: webpack.Options.WatchOptions;
|
||||
publicPath?: string;
|
||||
index?: string;
|
||||
headers?: {
|
||||
[name: string]: string;
|
||||
};
|
||||
stats?: webpack.Options.Stats;
|
||||
reporter?: webpackDevMiddleware.Reporter | null;
|
||||
serverSideRender?: boolean;
|
||||
|
||||
log?: webpackDevMiddleware.Logger;
|
||||
warn?: webpackDevMiddleware.Logger;
|
||||
error?: webpackDevMiddleware.Logger;
|
||||
filename?: string;
|
||||
}
|
||||
|
||||
interface ConfigOptions {
|
||||
webpack: webpack.Configuration;
|
||||
webpackMiddlewareOptions: KarmaWebpackMiddlewareOptions;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import karma = require('karma');
|
||||
|
||||
export default function(config: karma.Config): void {
|
||||
config.set({
|
||||
files: ['src/index.spec.ts'],
|
||||
browsers: ['ChromeHeadless'],
|
||||
singleRun: true,
|
||||
frameworks: ['jasmine'],
|
||||
preprocessors: {'src/index.spec.ts': ['webpack', 'sourcemap']},
|
||||
webpack: {entry: 'test.js'},
|
||||
webpackMiddlewareOptions: {noInfo: true},
|
||||
reporters: ['spec']
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"paths": {
|
||||
"q": [ "q/v0" ]
|
||||
},
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"karma-webpack-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user