Remix.run Logo
thdhhghgbhy a day ago

Is there something this nice for JS, with the decorators like that?

ngruhn a day ago | parent | next [-]

No decorators, but fast-check has add-ons to various test frameworks. E.g. if you use Vitest you can write:

    import { test, fc } from '@fast-check/vitest'
    test.prop([fc.array(fc.double())])('sort is correct', (lst) => {
      expect(lst).toEqual(lst.toSorted())
    })
https://www.npmjs.com/package/@fast-check/vitest?activeTab=r...
chamomeal a day ago | parent [-]

Fast check is fantastic!! I found it to be pretty verbose but I think that’s just a typescript limitation. It’s VERY well typed, which was a nice surprise. Such a great library. Shrinking, model based testing, it’s really comprehensive

eru a day ago | parent | prev | next [-]

The decorators are a nice approach in Python, but they aren't really core to what Hypothesis does, nor what makes it better than eg Haskell's QuickCheck.

aidos a day ago | parent | prev | next [-]

Not decorators (or at least not last time I looked) but we use fast-check.

Was already familiar with and using Hypothesis in Python so went in search of something with similar nice ergonomics. Am happy with fast-check in that regard.

https://fast-check.dev/

greener_grass a day ago | parent | prev [-]

Decorators are just function application with more syntax.