← Back to context

Comment by ngruhn

15 hours ago

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...

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