Skip to content

Commit

Permalink
fix(karma-webpack): make webpackMiddleware optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Den-dp committed Jul 2, 2024
1 parent e1d3926 commit f3d04f8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion types/karma-webpack/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ declare module "karma" {

interface ConfigOptions {
webpack: Webpack.Configuration;
webpackMiddleware: KarmaWebpackMiddlewareOptions;
webpackMiddleware?: KarmaWebpackMiddlewareOptions;
}
}
11 changes: 11 additions & 0 deletions types/karma-webpack/karma-webpack-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,15 @@ export default function(config: karma.Config): void {
webpackMiddleware: { noInfo: true },
reporters: ["spec"],
});

// optional webpackMiddleware
config.set({
files: ["src/index.spec.ts"],
browsers: ["ChromeHeadless"],
singleRun: true,
frameworks: ["jasmine"],
preprocessors: { "src/index.spec.ts": ["webpack", "sourcemap"] },
webpack: { entry: "test.js" },
reporters: ["spec"],
});
}
2 changes: 1 addition & 1 deletion types/karma-webpack/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@types/karma-webpack",
"version": "2.0.9999",
"version": "4.0.2",
"projects": [
"https://github.com/webpack-contrib/karma-webpack"
],
Expand Down

0 comments on commit f3d04f8

Please sign in to comment.