
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
videojs-generate-karma-config
Advanced tools
Generate a standard karma config, so that plugins don't need the same script in every repository.
Currently our karma configs are the same for most plugins, but when the default config changes a bit, every repository has to be updated since it is a static file. This package will provide the standard config as a module, so that updates can be deployed much easier.
Lead Maintainer: Brandon Casey @brandonocasey
Maintenance Status: Stable
Table of Contents
$ npm install --save-dev karma videojs-generate-karma-config
Then in your karma config do
const generateKarmaConfig = require('videojs-generate-karma-config');
module.exports = function(config) {
const options = {};
config = generateKarmaConfig(config, options);
};
By default all options are passed as the second argument to generateKarmaConfig.
filesType:
FunctionDefault:noneNOTE: Be very careful with this option, this will effect ci runs as well.
A function that should take one argument, the array of files that are included, and return an array of files that should be included. This is used to manually overide the files that are included ina test run
Default files that will be passed to you function
[
'node_modules/video.js/dist/video-js.css',
'dist/*.css',
'node_modules/sinon/pkg/sinon.js',
'node_modules/video.js/dist/video.js',
'test/dist/bundle.js'
]
Example with files function:
module.exports = function(config) {
const options = {
files(defaultFiles) {
return defaultFiles.concat([
'some-other-file.js'
]);
}
};
config = generateKarmaConfig(config, options);
};
browsersType:
FunctionDefault:none
NOTE: Be very careful with this option, this will effect ci runs as well.
A function that should take one argument, the array of browsers that are about to run, and return an array of browsers that should run. This is used to manually overide the browsers that should run.
Example with detected browsers:
module.exports = function(config) {
const options = {
browsers(aboutToRun) {
// never test on Safari
return aboutToRun.filter(function(launcherName) {
return launcherName !== 'Safari';
});
}
};
config = generateKarmaConfig(config, options);
};
preferHeadlessType:
BooleanDefault:true
If we should prefer running headless browsers. This will change the defaults for ciLaunchers as well as automatic browser detection. Make sure to handle this in browsers
serverBrowsersType:
FunctionDefault:none
A function that should return an array of browsers that should run when in static server mode (--single-run=false). It should take one argument: The default serverBrowsers array which is [].
Example:
module.exports = function(config) {
const options = {
serverBrowsers(defaults) {
serverBrowsers.push('myTestLauncher');
return serverBrowsers;
}
};
config = generateKarmaConfig(config, options);
};
customLaunchersType:
FunctionDefault:none
A function that should return an object of karma custom launchers. It should take one argument: The default custom launchers object which is: {};
Example:
module.exports = function(config) {
const options = {
customLaunchers(defaults) {
return Object.assign(defaults, {
myTestLauncher: {
base: 'ChromeHeadless'
}
};
}
};
config = generateKarmaConfig(config, options);
};
ciLaunchersType:
FunctionDefault:{}
NOTE: All browsers contained from this object will be run on ci unless BROWSER_STACK_USERNAME is in the enviornment!
A function that should return an object containing karma custom launchers, that should all be run on ci. It should take one argument.: The default ci launchers object which empty is:
Example:
module.exports = function(config) {
const options = {
ciLaunchers(defaults) {
// add another browser to travis testing
return Object.assign(defaults, {
myTestLauncher: {
base: 'ChromeHeadless'
}
};
}
};
config = generateKarmaConfig(config, options);
};
browserstackLaunchersType:
FunctionDefault:none
NOTE: all browsers contained in this list will be run if there is an enviornment variable called BROWSER_STACK_USERNAME present!
A function that should return an object containing karma custom launchers, that should all be run on browserstack. It should take one argument: The default browserstack launchers object which is:
{
bsChrome: {
base: 'BrowserStack',
browser: 'chrome',
os: 'Windows',
os_version: '10'
},
bsFirefox: {
base: 'BrowserStack',
browser: 'firefox',
os: 'Windows',
os_version: '10'
},
bsSafariSierra: {
base: 'BrowserStack',
browser: 'safari',
os: 'OS X',
os_version: 'Sierra'
},
bsEdgeWin10: {
base: 'BrowserStack',
browser: 'edge',
os: 'Windows',
os_version: '10'
},
bsIE11Win10: {
base: 'BrowserStack',
browser: 'ie',
browser_version: '11',
os: 'Windows',
os_version: '10'
},
bsIE11Win7: {
base: 'BrowserStack',
browser: 'ie',
browser_version: '11',
os: 'Windows',
os_version: '7'
}
}
module.exports = function(config) {
const options = {
BrowserstackLaunchers(defaults) {
// only test on Edge windows 10
return {
bsEdgeWin10: defaults.bsEdgeWin10;
};
}
};
config = generateKarmaConfig(config, options);
};
For more information on browserstack launchers see the docs.
coverageType:
FunctionDefault:true
If we should report test coverage or not, by default we do.
Example with coverage turned off
module.exports = function(config) {
const options = {
coverage: false
};
config = generateKarmaConfig(config, options);
};
showQUnitUIType:
BooleanDefault:falseif in single-run mode,trueotherwise
Show the QUnit UI in non-debug runs of Karma. This sets both client.clearContext = false and client.qunit.showUI: true.
Having clearContext turned off increases test reliability. However, sometimes, showing the QUnit UI during test runs is useful to track down a test that is timing out or failing, particularly on CI/Browserstack.
Type: 'Array' Default: 'dots' for CI and 'progress' for local.
If passed in, the value passed will be used. If coverage is turned on, and reporters is being set, 'coverage' must be included in the list. 'coverage' is removed from the list if the coverage setting is false.
lcov, json, and html coverage reports will be generated in test/dist/coverage after a test run. Unless coverage is set to false.
codecov -f test/dist/coverage/lcov.info on your ci after testingNOTE: When running as a static server the "serverBrowsers" will have to finish running before you see this. See serverBrowsers
test/dist/coverage/index.htmlcat test/dist/coverage/text.txt or if you want a cross platform way use shx. shx cat test/dist/coverage/text.txtAny Karma settings that have not been exposed as an option can be overriden after calling generateKarmaConfig.
Example:
module.exports = function(config) {
const options = {};
config = generateKarmaConfig(config, options);
// The reporters setting is not exposed as an option currently
config.reporters = ['spec'];
};
FAQs
Generate a standard karma config, so that plugins don't need the same script in every repository.
The npm package videojs-generate-karma-config receives a total of 731 weekly downloads. As such, videojs-generate-karma-config popularity was classified as not popular.
We found that videojs-generate-karma-config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 20 open source maintainers 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
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.