Permalink
Browse files

Add test files

  • Loading branch information...
mattbierner committed Sep 3, 2016
1 parent bd570d2 commit b80c0c3d1b061f01f7c3908b015232e83bacd911
Showing with 37 additions and 0 deletions.
  1. +3 −0 README.md
  2. +11 −0 tests/maybe.js
  3. +11 −0 tests/reader.js
  4. +12 −0 tests/writer.js
View
@@ -9,6 +9,9 @@
2) Javascript <a href="https://en.wikibooks.org/wiki/Haskell/Monad_transformers">monad transformer</a> library
</p>
```js
$ npm install --save akh
```
## Overview
Akh is a collection of monad and monad transformers that implement [Fantasy Land's][fl] interfaces. It is inspired by [Haskell's MTL](https://hackage.haskell.org/package/mtl).
View
@@ -0,0 +1,11 @@
"use strict";
const assert = require('chai').assert
const Maybe = require('../index').Maybe
const MaybeT = require('../index').Maybe
describe("Maybe", () => {
it("should be imported", () => {
const c = Maybe.of(3)
assert.strictEqual(3, Maybe.maybe(c))
})
})
View
@@ -0,0 +1,11 @@
"use strict";
const assert = require('chai').assert
const Reader = require('../index').Reader
const ReaderT = require('../index').Reader
describe("Reader", () => {
it("should be imported", () => {
const c = Reader.asks(x => x.x)
assert.strictEqual(2, Reader.run(c, { x: 2 }))
})
})
View
@@ -0,0 +1,12 @@
"use strict";
const assert = require('chai').assert
const Writer = require('../index').Writer
const WriterT = require('../index').Writer
const List = require('../index').List
describe("Writer", () => {
it("should be imported", () => {
const c = Writer.tell(List.of(2))
assert.deepEqual([2], Writer.run(c, List.mzero).output.run())
})
})

0 comments on commit b80c0c3

Please sign in to comment.