
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.
@smartlyio/fake-time
Advanced tools
Fake time AND timers in jest. This here thing aims to solve three(!) problems
A working example
// yarn jest examples/working.ts
import * as fakeTime from '../index';
describe('fake-time', () => {
beforeEach(fakeTime.fake);
afterAll(fakeTime.restore);
it('advances time', async () => {
const start = Date.now();
await fakeTime.advance(1000);
expect(Date.now() - start).toBeGreaterThan(1000);
});
it('runs promises and new timers from timers', async () => {
const interval = 10;
let hits = 0;
async function set() {
hits++;
await Promise.resolve();
setTimeout(set, interval);
}
await set();
await fakeTime.advance(interval * 10);
expect(hits).toBeGreaterThan(10);
});
describe('wait', () => {
const dayInMs = 24 * 60 * 50 * 1000;
it('advances time while waiting', async () => {
const start = Date.now();
await fakeTime.wait(async () => expect(Date.now() - start).toBeGreaterThan(dayInMs), {
untilMs: dayInMs * 2 * 10,
});
});
});
});
FAQs
fake time and timers
We found that @smartlyio/fake-time 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.