no-day / create-fp-ts-lib

Bootstrap libraries that follow common fp-ts coding, documentation and testing patterns
40 stars 6 forks source link

Wrap fast-check test with "fc.assert" #4

Closed m-bock closed 3 years ago

m-bock commented 3 years ago

It should be:

describe('greet', () => {
  it('greets anything', () => {
    fc.assert(
      fc.property(fc.string(), (name) => {
        expect(myLib.greet(name)).toBe(`Hello, ${name}!`)
      })
    )
  })
})

Or maybe even use: https://github.com/dubzzz/jest-fast-check ?