Skip to content

Commit

Permalink
revert ChainRec test removal
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti committed Dec 11, 2019
1 parent baf70f3 commit 824362f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ high state of flux, you're at risk of it changing without notice.
# 0.6.0

- **Breaking Change**
- upgrade to `[email protected].1` (@gcanti)
- upgrade to `[email protected].2` (@gcanti)

# 0.5.0

Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
},
"homepage": "https://github.com/gcanti/fp-ts-fluture",
"peerDependencies": {
"fluture": "^12.0.0",
"fluture": "^12.0.2",
"fp-ts": "^2.0.0"
},
"devDependencies": {
"@types/mocha": "2.2.38",
"@types/node": "^12.12.11",
"docs-ts": "^0.1.0",
"fluture": "^12.0.1",
"fluture": "^12.0.2",
"fp-ts": "^2.0.0",
"mocha": "3.2.0",
"prettier": "^1.19.1",
Expand Down
6 changes: 6 additions & 0 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ConcurrentFutureInstance, promise, reject, resolve, FutureInstance } fr
import { array } from 'fp-ts/lib/Array'
import { concurrentFuture } from '../src/ConcurrentFuture'
import { future } from '../src/Future'
import { left, right } from 'fp-ts/lib/Either'

describe('Future', () => {
it('should work with sequence (failure case)', done => {
Expand Down Expand Up @@ -31,6 +32,11 @@ describe('Future', () => {
const n3 = await promise(f3).catch(() => 3)
assert.deepEqual([n1, n2, n3], [1, 2, 3])
})

it('should export a ChainRec instance', async () => {
const ma = future.chainRec(0, n => resolve(n < 20_000 ? left(n + 1) : right(n)))
assert.strictEqual(await promise(ma), 20000)
})
})

describe('ConcurrentFluture', () => {
Expand Down

0 comments on commit 824362f

Please sign in to comment.