
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
mocked-mocha-runner
Advanced tools
Helps to test Mocha reporters by simulating a test run without actually running Mocha
This is a small class to mock the Mocha runner to help test custom reporters. Simply pass this into the constructor of a Mocha custom reporter and test the reporter without needing to run Mocha.
$ npm i mocked-mocha-runner --save-dev
Below is an example that instantiates the MockedMochaRunner, creates some reporterOptions, and passes the options and the mockedRunner into the reporter.
The reporter's events are triggered by calling Mocha runner events using the mockedRunner methods.
it('should report some results', () => {
const mockedRunner = new MockedMochaRunner();
const reporterOptionsWrapper = {
"reporterOptions": {
"option1": "value1",
"option2": "value2",
"logger": console
}
}
const reporter = new TestEsmReporter(mockedRunner, reporterOptionsWrapper);
const mochaEvents = [
EVENT_RUN_BEGIN,
EVENT_SUITE_BEGIN,
EVENT_TEST_PASS,
EVENT_TEST_PASS,
EVENT_TEST_FAIL,
EVENT_TEST_PASS,
EVENT_TEST_PENDING,
EVENT_SUITE_END,
EVENT_RUN_END
];
mochaEvents.forEach((mochaEvent) => {
mockedRunner.fireEvent(mochaEvent);
});
expect(mockedRunner.hasEnded).to.equal(true);
});
Copyright (c) James Mortensen, 2023 MIT License
FAQs
Helps to test Mocha reporters by simulating a test run without actually running Mocha
The npm package mocked-mocha-runner receives a total of 0 weekly downloads. As such, mocked-mocha-runner popularity was classified as not popular.
We found that mocked-mocha-runner 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.