Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gcanti/fp-ts-laws

fp-ts type class laws for property based testing
https://github.com/gcanti/fp-ts-laws

fp-ts property-based-testing

Last synced: about 8 hours ago
JSON representation

fp-ts type class laws for property based testing

Awesome Lists containing this project

README

        



build status

[fp-ts](https://github.com/gcanti/fp-ts) type class laws for property based testing

Usage of [fast-check](https://github.com/dubzzz/fast-check) is required.

# Example

```ts
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 = {
concat: (x, y) => x + ' ' + y
}
laws.semigroup(semigroupSpace, eqString, fc.string())
})
})
```

For other examples check out the [tests](test/index.ts)