Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
bamboo-jest-reporter
Advanced tools
A reporter for Jest which parses the coverage-, snapshot- and test-results to a Mocha Test Parser format
An Atlassian Bamboo reporter for Jest tests.
This reporter will generate test results for:
Tests / coverage / snapshots can be separately disabled by environment variables:
This project was started based on https://github.com/adalbertoteixeira/jest-bamboo-formatter
Install and add the reporter to the development dependencies in package.json:
npm i bamboo-jest-reporter --save-dev
Add the test npm script in your package.json
"scripts": {
"test": "jest"
}
Configuring Jest can be done either in a configuration file (default:'jest.config.js') or in 'package.json': https://jestjs.io/docs/en/configuration
Add the following line to your configuration to add this reporter:
reporters: [ "default", "bamboo-jest-reporter" ],
If you do not need the default Jest reporter (the default Jest reporter prints the Jest results in the bash/cmd-client)
reporters: [ "bamboo-jest-reporter" ],
To add code coverage thresholds, add the following block to the configuration:
coverageThreshold: {
global: {
branches: 100,
functions: 100,
statements: 100,
lines: 100
}
},
To include coverage: simply collectCoverage to the Jest config
collectCoverage: true
Or configure npm test to collect coverage as well
"scripts": {
"test": "jest --coverage"
}
module.exports = {
collectCoverage: true,
coverageDirectory: "coverage",
reporters: [ "defaults", "bamboo-jest-reporter" ],
collectCoverageFrom: [
"**/*.js"
],
coverageThreshold: {
global: {
branches: 100,
functions: 100,
statements: 100,
lines: 100
}
}
}
jest: {
collectCoverage: true,
coverageDirectory: "coverage",
reporters: [ "defaults", "bamboo-jest-reporter" ],
collectCoverageFrom: [
"**/*.js"
],
coverageThreshold: {
global: {
branches: 100,
functions: 100,
statements: 100,
lines: 100
}
}
}
A mocha test report will be created (jest.json) after running:
npm test
You can disable:
By default tests / coverage and obsolete snapshots are all reported. When all reporting is on, the following scenarios will be logged as failures:
Prevent your Bamboo task from failing when the tests fail (exit 0):
#!/usr/bin/env bash
if ! npm test
then
echo "The automated jest tests did not pass. Please check the tests-tab"
exit 0
fi
Make Bamboo fail by interpreting the test-results:
Add a 'Mocha Test Parser'-task to your bamboo-job. Set 'jest.json' as testfile pattern.
FAQs
A reporter for Jest which parses the coverage-, snapshot- and test-results to a Mocha Test Parser format
The npm package bamboo-jest-reporter receives a total of 3,458 weekly downloads. As such, bamboo-jest-reporter popularity was classified as popular.
We found that bamboo-jest-reporter 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.