Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@diffblue/cover-client
Advanced tools
Diffblue Cover client library - Node.js API for Diffblue Cover
The Diffblue Cover client library provides a programmatic interface and CLI for communicating with the Diffblue Cover API.
Using npm:
npm install @diffblue/cover-client
To use Diffblue Cover to run an analysis and produce test files you will need to provide a JAR file of your compiled code and the path to a directory where you want test files to be written.
In Node.js (using promises):
const Analysis = require('@diffblue/cover-client').Analysis;
const fs = require('fs');
const analysis = new Analysis('https://your-cover-api-domain.com');
const buildFile = fs.createReadStream('./build.jar');
// This is a sample settings object that will not run a useful analysis.
// You can omit the settings parameter when calling `run` to start an analysis with default settings.
const settings = { phases: { firstPhase: { timeout: 10 }}};
const options = { outputTests: './tests' };
analysis.run({ build: buildFile }, settings, options)
.then((results) => {
console.log(`Analysis ended with the status: ${analysis.status}.`);
console.log(`Produced ${results.length} tests in total.`);
console.log(`Test files written to ${options.outputTests}.`);
});
In Typescript (using async/await):
import Analysis from '@diffblue/cover-client';
import { createReadStream } from 'fs';
const analysis = new Analysis('https://your-cover-api-domain.com');
const buildFile = createReadStream('./build.jar');
// This is a sample settings object that will not run a useful analysis.
// You can omit the settings parameter when calling `run` to start an analysis with default settings.
const settings = { phases: { firstPhase: { timeout: 10 }}};
const options = { outputTests: './tests' };
(async () => {
const results = await analysis.run({ build: buildFile }, settings, options);
console.log(`Analysis ended with the status: ${analysis.status}.`);
console.log(`Produced ${results.length} tests in total.`);
console.log(`Test files written to ${options.outputTests}.`);
})();
For more detailed usage, see the programmatic interface documentation.
Copyright 2019 Diffblue Limited. All Rights Reserved.
FAQs
Diffblue Cover client library - Node.js API for Diffblue Cover
The npm package @diffblue/cover-client receives a total of 13 weekly downloads. As such, @diffblue/cover-client popularity was classified as not popular.
We found that @diffblue/cover-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.