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.
testcafe-reporter-smtp
Advanced tools
###testcafe-reporter-smtp
This is a reporter for TestCafe. It sends the output of the test as an email via SMTP.
##Purpose Once configured the reporter builds an email (HTML and text format) and sends via an SMTP service. This means your test results will be emailed to you in a nicely formatted email.
##Setup instructions
$ npm install testcafe-reporter-smtp
Configuration is taken from two sources:
The aim is that you can specify the below configuration parameters either entirely in your local environment variables, or in the config file on disk, or a mixture of both.
.env
.nodemailer
secure option (see Security and TLS below)require("os").userInfo()
nodemailer
logger option, causes verbose output on the consoleYou probably want the connection to your SMTP server to be encrypted using TLS. From the nodemailer
documentation:
secure – if true the connection will use TLS when connecting to server. If false (the default) then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false
So, if you leave out TESTCAFE_SMTP_SECURE
, the reporter will make a plaintext connection to your server, but if it responds with STARTTLS then the connection will be upgraded to encryption using TLS before authentication is performed.
Run the unit tests, which set a dummy SMTP hostname that causes the reporter to not actually send the email it has built.
$ npm test
The unit test uses Mocha, and does not actually invoke a Testcafe test run or send any emails.
You can run TestCafe with testcafe-reporter-smtp either via the command line, or via a test runner.
You must have an SMTP server available to test and a username on it, e.g. gmail.com with your Google credentials.
cd into your test project.
Edit or create the .env
file by adding the following required variables:
Alternatively, call the config file anything you want and set TESTCAFE_SMTP_CONFIG_FILE=<filename>
.
$ testcafe chrome 'path/to/test/file.js' --reporter smtp
Please Note: The command line testcafe
binary executes a forced process stop once the test has finished running, which will probably terminate before the SMTP communication has completed. You may have better results using the runner API below.
When you use TestCafe API, you can pass the reporter name to the reporter()
method:
const createTestCafe = require('testcafe');
let runner = null;
let testcafe = null;
createTestCafe('localhost', 1337, 1338)
.then(tc => {
testcafe = tc;
runner = tc.createRunner();
return runner
.src('index.ts') // This is the test fixture to run
.browsers(['chrome'])
.reporter('smtp') // This tells it to look for testcafe-reporter-smtp
.run()
.then(failedCount => {
console.log('Runner finished, failedCount: ', failedCount);
testcafe.close();
})
.catch(error => {
console.error('Caught error: ', error);
});
});
##Further Documentation TestCafe Reporter Plugins
[0.1.0] - 2021-06-29
FAQs
TestCafe SMTP reporter plugin.
The npm package testcafe-reporter-smtp receives a total of 30 weekly downloads. As such, testcafe-reporter-smtp popularity was classified as not popular.
We found that testcafe-reporter-smtp 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.