
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
wix-eventually
Advanced tools
Retries promise until timeout expires in a linear fashion with delays defined by interval. Given this module is inteded to be used only within tests it does not provide more robust strategies like retry-as-promised, but instead is designed to be predictable and fit within timeouts defined for your tests.
Uses defaults:
npm install --save-dev wix-eventually
const eventually = require('wix-eventually')
const {expect} = require('chai')
describe('example', () => {
it('should retry', async () => {
let hasCompleted = false
setTimeout(() => (hasCompleted = true), 1000)
await eventually(() => {
expect(hasCompleted).to.equal(true)
})
})
})
Wraps a promise that retries a function n times with 200 ms delay in between;
Arguments:
Returns a function with provided defaults - {timeout, interval}.
Using this library might cause an anti-pattern of writing tests that take a long time to run.
For example, if the code is using setTimeout, it's "easy" to use eventually to check the result.
In case the timeout is set for 3 seconds, the test will now take 3 seconds.
Instead, the code should be written in such way that the setTimeout functionality can be modified in the test to either run synchronously or with a very short timeout value.
FAQs
retrying execution of function for tests
The npm package wix-eventually receives a total of 1,624 weekly downloads. As such, wix-eventually popularity was classified as popular.
We found that wix-eventually 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.