Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
karma-parallel
Advanced tools
A Karma JS Framework to support sharding tests to run in parallel across multiple browsers
A Karma JS plugin to support sharding tests to run in parallel across multiple browsers.
This is intended to speed up the time it takes to run unit tests by taking advantage of multiple cores. From a single
karma server, multiple instances of a browser are spun up. Each browser downloads all of the spec files, but when a
describe
block is encountered, the browsers deterministically decide if that block should run in the given browser.
This leads to a way to split up unit tests across multiple browsers without changing any build processes.
The easiest way is to install karma-parallel
as a devDependency
.
Using NPM
npm install karma-parallel --save-dev
Using Yarn
yarn add karma-parallel --dev
// karma.conf.js
module.exports = function(config) {
config.set({
frameworks: ['mocha' /* or 'jasmine' */, 'parallel'], // this will load the framework and beforeMiddleware
parallelOptions: {
executors: 4,
shardStrategy: 'round-robin' /* or 'description-length' */
}
});
};
parallelOptions [object]
: Options for this plugin
parallelOptions.executors [int=cpu_cores-1]
: The number of browser instances to
use to test. If you test on multiple types of browsers, this spin up the number of
executors for each browser type.
parallelOptions.shardStyle [string='round-robin']
: This plugin works by
overriding the test suite describe()
function. When it encounters a describe, it
must decide if it will skip the tests inside of it, or not.
round-robin
style will only take every executors
test suite and skip the ones in between.description-length
deterministically checks the length of the description for each test suite use a modulo of the number of executors.For more information on Karma see the homepage.
This similar project works by splitting up the actual spec files across the browser instances.
Pros:
Cons:
karma-webpack
or karma-browserify
FAQs
A Karma JS Framework to support sharding tests to run in parallel across multiple browsers
The npm package karma-parallel receives a total of 42,843 weekly downloads. As such, karma-parallel popularity was classified as popular.
We found that karma-parallel 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.