
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
rapid-check
Advanced tools
Yet another implementation of property based testing framework with support for async properties.
Yet another implementation of property based testing framework with support for async properties.
It's based on async generators, therefore it requires nodejs >=10.
npm install rapid-check
Works with any testing framework, here's an example using jest >=23:
const { gen } = require('rapid-check')
const toMatchProperty = require('rapid-check/src/jest.matcher')
expect.extend({ toMatchProperty })
test('Set.has function', async () => {
const prop = (v) => new Set([1, 2, 3]).has(v)
await expect(gen.choose(1, 3)).toMatchProperty(prop)
})
sample(constantly(4))
// [4, 4, 4, 4, ...]
sample(choose(1, 3))
// [2, 1, 3, 1, ...]
sample(bool)
// [true, true, false, true, ...]
sample(int)
// [0, 1, -2, 3, ...]
sample(uint)
// [0, 1, 0, 3, ...]
sample(tuple(uint, uint))
// [[0, 0], [1, 0], [1, 2], [0, 1], ...]
sample(array(uint, 1, 3))
// [[0], [1], [2, 0], [1, 1], [0], [0, 3, 3], ...]
sample(oneOf(bool, uint))
// [true, 1, 2, false, ...]
Where f: a -> b
const negate = (n) => -n
sample(fmap(negate, uint))
// [0, -1, -1, -3, ...]
Where f: a -> Gen b
const f = (n) => ap(tuple, repeat(bool, n))
sample(mbind(f, uint))
// [[], [true], [false, false], [false], ... [true, false, false, true, false], [false]]
FAQs
Yet another implementation of property based testing framework with support for async properties.
We found that rapid-check 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
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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.