Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
fp-ts-quickcheck
Advanced tools
fp-ts port of Haskell's QuickCheck.
NOTE Please note that shrinking is not yet available. Purescript did the same, so this should be enough to get you started. When shrinking is available, it will be transparently added as major release.
yarn add -D fp-ts-test
Grab your favourite test library, in this case jest
, and put the assertion call of this library into the test caller.
// main.ts
export function subtract(x: number, y: number) {
return x - y
}
// main.spec.ts
import { quickcheck as qc, arbitrary as AT } from "fp-ts-test"
import { expect, it, describe } from "@jest/globals"
import { pipe } from "fp-ts/function"
import { subtract } from "./main"
describe(subtract, () => {
const numnum = AT.tuple(AT.number, AT.number)
it(
"should always be smaller than the first argument",
// returns a thunk by default, because `qc.assert` throws
qc.assertIO(numnum, ([x, y]) => x > subract(x, y)),
)
it(
"should matter which order the arguments are passed",
// returns a thunk by default, because `qc.assert` throws
qc.assertIO(numnum, ([x, y]) => subtract(y, x) !== subract(x, y)),
)
})
FAQs
Unknown package
The npm package fp-ts-quickcheck receives a total of 1 weekly downloads. As such, fp-ts-quickcheck popularity was classified as not popular.
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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.