Lurker News
What are you working on? Any new ideas that you're thinking about?

Comments (1,424) 746 threads

Show all comments

Showing thread 198 of 746

skybrian#
I'm writing a new property-testing library for TypeScript. [1]

I wanted a way to define new Arbitraries that's easier than working with .map(), .chain(), .oneOf(), and other combinators that require you to think in terms of sets. It has those combinators, but you can also write code to randomly generate one value at a time. It uses an approach to shrinking that's inspired by Hypothesis.
Along the way, I ended up adding a Domain subclass, which also does validation like Zod. Not sure where I'm going with that, but it's also useful for generating unique keys.
(The documentation isn't done and doesn't explain what's interesting about it. Caveat: it's Deno-only, and will probably stay that way unless someone wants to help.)
[1] https://jsr.io/@skybrian/repeat-test