Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
fp-ts port of Haskell's QuickCheck and (not implemented yet) Python's Hypothesis.
Please note that shrinking is not yet available. Purescript did the same, so this should be enough to get you started.
NOTE: Still in development. It works, but the developer experience of the API surface needs some more additions.
This library does not exist on NPM yet, so use the built versions in this repo instead.
yarn add fp-ts && yarn add -D fp-ts-test
Grab your favourite test runner like jest
, put the assertion call of this library into the 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 arbitrary = qc.tuple(qc.number, qc.number)
it(
"should always be smaller than the first argument",
pipe(
arbitrary,
// returns a thunk by default, because `qc.assert` throws
qc.assert(([x, y]) => x > subract(x, y)),
),
)
it(
"should matter which order the arguments are passed",
pipe(
arbitrary,
// returns a thunk by default, because `qc.assert` throws
qc.assert(([x, y]) => subtract(y, x) !== subract(x, y)),
),
)
})
FAQs
Unknown package
The npm package fp-ts-test receives a total of 0 weekly downloads. As such, fp-ts-test popularity was classified as not popular.
We found that fp-ts-test 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.