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.
pactum-swagger-coverage
Advanced tools
JSON swagger coverage reporter for Pactum tests. It's capable of reading the swagger definitions from either swagger.yaml
or swagger.json
(served on a http server endpoint).
npm install --save-dev pactum pactum-swagger-coverage
const pactum = require('pactum');
const psc = require('pactum-swagger-coverage');
const reporter = pactum.reporter;
// global before block
before(() => {
reporter.add(psc);
});
// global after block
after(() => {
return reporter.end();
});
const psc = require('pactum-swagger-coverage');
// name of the report file - defaults to "swagger-cov-report.json"
psc.file = 'report-name.json';
// folder path for the report file - defaults to "./reports"
psc.path = './reports-path';
// Swagger json url of the server - defaults to ""
psc.swaggerJsonUrl = "http://localhost:3010/api/server/v1/json";
// Swagger Yaml file path - defaults to ""
psc.swaggerYamlPath = './tests/testObjects/swagger.yaml';
{
"basePath": "/api/server/v1",
"coverage": 0.2,
"coveredApiCount": 1,
"missedApiCount": 4,
"totalApiCount": 5,
"coveredApiList": [
"/getallninjas"
],
"missedApiList": [
"/health",
"/getninjabyid/{id}",
"/getninjabyname/{name}",
"/getninjabyrank/{rank}"
]
}
Note: Either 'swaggerJsonUrl' or 'swaggerYamlPath' should be provided for reporter to work.
Read more about Pactum here.
Inspired by swagger-coverage-postman.
FAQs
Swagger api coverage report for pactum tests
The npm package pactum-swagger-coverage receives a total of 430 weekly downloads. As such, pactum-swagger-coverage popularity was classified as not popular.
We found that pactum-swagger-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.
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.