Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/gcanti/fp-ts-laws
- Owner: gcanti
- License: mit
- Created: 2019-03-16T08:50:45.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-24T17:13:32.000Z (about 1 year ago)
- Last Synced: 2024-10-26T20:39:50.163Z (14 days ago)
- Topics: fp-ts, property-based-testing
- Language: TypeScript
- Homepage: https://gcanti.github.io/fp-ts-laws/
- Size: 148 KB
- Stars: 81
- Watchers: 5
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[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)