
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
karma-webpack-bundle
Advanced tools
A personalized bundle of karma libraries and configs
npm install karma-webpack-bundle --save-dev
object
Settings object for karma-benchmark. I don't see any need for benchmarks to run for 5 seconds, so I've provided settings that run the benchmark for 200ms.
Properties
Name | Type | Default |
---|---|---|
[maxTime] | number | 0.2 |
[minTime] | number | 0.2 |
[minSamples] | number | 1 |
[delay] | number | 0 |
[async] | boolean | true |
Example
const {benchSettings} = require('karma-webpack-bundle');
benchmark('how fast is this', () => {
[1, 2, 3].map((x) => x * 2);
}, benchSettings);
object
An eslint config object that overrides various rules from the main config for bench files.
Example
Create a file in your bench directory called .eslintrc.cjs:
const { eslintrcBench } = require('karma-webpack-bundle');
module.exports = eslintrcBench;
object
An eslint config object intended to live in the root of your project.
Example
Create a file in the root of your project called .eslintrc.cjs:
const { eslintrc } = require('karma-webpack-bundle');
module.exports = eslintrc;
object
An eslint config object that overrides various rules from the main config for test files.
Example
Create a file in your tests directory called .eslintrc.cjs:
const { eslintrcTests } = require('karma-webpack-bundle');
module.exports = eslintrcTests;
string
A plugin for the karma-benchmarkjs-reporter formatBenchmark option. Only current difference with the default formatter is the hz number is passed through toLocaleString to make the number more readable. This is used in karmaBenchConfig.
Param | Type | Description |
---|---|---|
benchmark | object | The benchmark object. |
browser | object | Browser data. |
config | object | The config object. |
function
Returns a config function that can be used with karma-benchmark. Sets up karma-benchmark to run in Chrome headless with karma-benchmarkjs-reporter (with the local formatBenchmark formatter), and webpack in production mode. Looks for files in a bench directory that match **/*.bench.js.
Param | Type | Description |
---|---|---|
[settings] | object | Overrides any of the provided settings. |
Example
create a file in the root of your project called karma.bench.conf.js:
const {karmaBenchConfig} = require('karma-webpack-bundle');
module.exports = karmaBenchConfig();
and add a script to package.json:
"bench": "karma start karma.bench.conf.js"
then run it:
npm run bench
function
Returns a config function that can be used with karma. Sets up karma to run in Chrome headless and Firefox headless with mocha and karma-mocha-reporter.
If --single-run is provided then webpack runs in production mode, otherwise it runs in dev mode.
If running on Travis CI then karma-coverage and karma-coveralls are added to reporters
By default it Looks for test files in a tests directory that match *.test.js. For source files it looks for index.js, and *.js files in a src directory or lib directory.
Param | Type | Description |
---|---|---|
[testRunnerConfig] | Array | A valid config for test-runner-config. |
[settings] | object | Overrides any of the provided settings. |
Example
Create a file in the root of your project called karma.conf.js:
const { karmaConfig } = require('karma-webpack-bundle');
module.exports = karmaConfig();
and add a script or two to package.json:
"test": "karma start --single-run",
"test-watch": "karma start",
then run it:
npm test
function
Returns a config function that can be used with wallaby. Sets the test framework to mocha, runs in Chrome headless, and sets up webpack similar to the karma config.
By default it Looks for test files in a tests directory that match *.test.js. For source files it looks for index.js, and *.js files in a src directory or lib directory.
Param | Type | Description |
---|---|---|
[testRunnerConfig] | Array | A valid config for test-runner-config. |
[settings] | object | Overrides any of the provided settings. |
Example
create a file in the root of your project called wallaby.conf.js:
const { wallabyConfig } = require('karma-webpack-bundle');
module.exports = wallabyConfig();
FAQs
A personalized bundle of karma libraries and configs
We found that karma-webpack-bundle demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.