
Product
Announcing Precomputed Reachability Analysis in Socket
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
testcafe-reporter-custom
Advanced tools
TestCafe reporter that allows you to provide your own logic
This is the custom reporter plugin for TestCafe.
npm install testcafe-reporter-custom
When you run tests from the command line, specify the reporter name by using the --reporter
option:
testcafe chrome 'path/to/test/file.js' --reporter custom
When you use API, pass the reporter name to the reporter()
method:
testCafe
.createRunner()
.src('path/to/test/file.js')
.browsers('chrome')
.reporter('custom') // <-
.run();
After that you can define your custom logic in reporter/index.js
file.
It can be defined as an object or factory function.
For example:
module.exports = function () {
return {
async reportTaskStart(/* startTime, userAgents, testCount */) {
throw new Error('Not implemented');
},
async reportFixtureStart(/* name, path, meta */) {
throw new Error('Not implemented');
},
async reportTestStart(/* name, meta */) {
// NOTE: This method is optional.
},
async reportTestDone(/* name, testRunInfo, meta */) {
throw new Error('Not implemented');
},
async reportTaskDone(/* endTime, passed, warnings, result */) {
throw new Error('Not implemented');
}
};
}
API is completely the same as for regular reporter.
Reporter can be configured using reporter.config.js
file, which should be placed in a project root folder.
module.exports = {
path: 'reporter/main.js'
};
Possible options are presented in the table below.
Option | Default Value | Description |
---|---|---|
path | 'reporter/index.js' | Path to your reporter. |
moduleType | 'commonjs' | Whether your reporter uses CommonJS or ES Modules. Possible values are commonjs and module . |
tsNodePath | 'node_modules/ts-node' | Path to your ts-node installation (only used for *.ts files). |
tsOptions | undefined | ts-node options (only used for *.ts files). |
In order to use TypeScript with this reporter, at least ts-node
and typescript
packages should be installed.
npm install --save-dev ts-node typescript
After that you need to create reporter.config.ts
file and specify path
to your reporter.
module.exports = {
path: 'reporter/index.ts'
};
As testcafe-reporter-custom
use ts-node
in order to execute TypeScript files, all it's rules are applied.
If you want to provide additional ts-node
options, you can use tsOptions
in the reporter configuration file.
For example, you can specify custom tsconfig
file using the following configuration:
module.exports = {
path: 'reporter/index.ts',
tsOptions: {
project: 'tsconfig.reporter.json'
}
};
There is a couple of usage examples available in this repository:
FAQs
TestCafe reporter that allows you to provide your own logic
We found that testcafe-reporter-custom 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 precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.