Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
testaged-coverage
Advanced tools
Readme
Use this library to execute tests on your git staged files and verify they comply with the test coverage threshold.
yarn add global testaged-coverage
or
npm install testaged-coverage -g
.
Before the tests are run, make sure you have set a Jest "coverageThreshold". You can learn how to configure it here.
// package.json
{
...
"jest": {
"coverageThreshold": {
"global": {
"branches": 80,
"functions": 80,
"lines": 80,
"statements": 80
}
}
}
}
You need to stage your files first with git add
.
You will need to have husky installed.
In your package.json
, add the script to run as a pre-commit hook.
// package.json
{
"husky": {
"hooks": {
"pre-commit": "testaged-coverage && <you can include other scripts here (e.g. lint-staged)>"
}
},
}
Just execute testaged-coverage
Starting 1.3.0 you can add a --basedir array of folders where to look for tests
testaged-coverage --basedir="src scripts folder1 folder2"
By default --basedir is folder src
This library assumes you have a script setup for tests in your package.json
.
// package.json
{
"scripts": {
"test": "jest"
},
}
If you are using versions 1.3.3 or lower, when running testaged-coverage
, you will need to add the environment variable CI=true
to your test
script in your package.json
in order to prevent the script from running in watch mode. This will no longer be necessary from versions 1.3.4 and on.
FAQs
Utility script to run tests and verify coverage threshold for stages files
The npm package testaged-coverage receives a total of 85 weekly downloads. As such, testaged-coverage popularity was classified as not popular.
We found that testaged-coverage 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.