
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
pythagora-dev
Advanced tools
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/10895136/217571898-14e94ea7-75a5-4a50-a7dc-486e10a8b462.png"> <img height="300px" alt="Text changing depending on mode. Lig
Generate 90% code coverage with integration tests in 1 hour
To integrate Pythagora into your Node.js app, you just need to paste one line of code
if (global.Pythagora) global.Pythagora.setApp(app);
and run the Pythagora capture command. Then, just play around with your app and from all API requests and database queries Pythagora will generate integration tests.
Watch Pythagora Demo (2:28 min)
npm install pythagora
global.Pythagora
right after you initialize Express. Eg. if you initialize Express with let app = express();
then add this on the next line:
if (global.Pythagora) global.Pythagora.setApp(app);
npx pythagora --mode capture --initScript ./path/to/your/server.js
Eg. if you start your Node.js app with node ./server.js
then the command would be:
npx pythagora --mode capture --initScript ./server.js
Ctrl + C
)
After you captured all requests you want, you just need to add the mode parameter --mode test
to the Pythagora command.
npx pythagora --script ./path/to/your/server.js --mode test
Code coverage is a great metric while building automated tests as it shows us which lines of code are covered by the tests. Pythagora uses nyc
to generate a report about code that was covered with Pythagora tests. By default, Pythagora will show you the basic code coverage report summary when you run tests.
If you want to generate a more detailed report, you can do so by running Pythagora with --full-code-coverage-report
flag. Eg.
npx pythagora --script ./path/to/your/server.js --mode test --full-code-coverage-report
You can find the code coverage report inside pythagora_data
folder in the root of your repository. You can open the HTML view of the report by opening pythagora_data/code_coverage_report/lcov-report/index.html
.
In case you don't want the code coverage to be shown at all while running tests, you can run the tests with --no-code-coverage
parameter.
FAQs
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/10895136/217571898-14e94ea7-75a5-4a50-a7dc-486e10a8b462.png"> <img height="300px" alt="Text changing depending on mode. Lig
We found that pythagora-dev 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.