Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
fp-ts-quickcheck
Advanced tools
fp-ts port of Haskell's QuickCheck.
NOTE Please note that shrinking is exposed, but not used in the assertions. When used in the assertions, this library will be ready for production use.
yarn add -D fp-ts-quickcheck
Grab your favourite test library, in this case jest
, and put the assertion call of this library into the test caller.
export function add(x: number, y: number) {
return x + y
}
import { quickcheck, arbitrary } from "fp-ts-quickcheck"
import { expect, it, describe } from "@jest/globals"
import { pipe } from "fp-ts/function"
describe(add, () => {
const numnum = arbitrary.tuple(arbitraty.int(), arbitrary.int())
it("should be an associative operation", () => {
// returning a boolean
quickcheck.sync(numnum, ([x, y]) => add(y, x) === add(x, y))
})
it("should be an associative operation", () => {
// throwing an assertion error
quickcheck.sync(numnum, ([x, y]) => {
expect(add(x, y)).toBe(add(y, x))
})
})
})
FAQs
Unknown package
We found that fp-ts-quickcheck 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.