Fp Ts Laws Save

fp-ts type class laws for property based testing

Project README

build status

fp-ts type class laws for property based testing

Usage of fast-check is required.

Example

import * as laws from 'fp-ts-laws'
import * as fc from 'fast-check'

import { Semigroup } from 'fp-ts/Semigroup'
import { eqString } from 'fp-ts/Eq'

describe('my semigroup instance', () => {
  it('should test Semigroup laws', () => {
    const semigroupSpace: Semigroup<string> = {
      concat: (x, y) => x + ' ' + y
    }
    laws.semigroup(semigroupSpace, eqString, fc.string())
  })
})

For other examples check out the tests

Open Source Agenda is not affiliated with "Fp Ts Laws" Project. README Source: gcanti/fp-ts-laws
Stars
79
Open Issues
1
Last Commit
7 months ago
Repository
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating