Last active
November 20, 2015 03:16
-
-
Save reharik/6d98a4afa35a615e5d2a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| return function(event, handelr){ | |
| var Future = _fantasy.Future; | |
| //checkIfProcessed:: JSON -> Future<string|JSON> | |
| var checkIfProcessed = i => Future((rej,ret) => i.isIdempotent ? ret(i) : rej('item has already been processed')); | |
| //checkIdempotence JSON -> Future<string|JSON> | |
| var checkIdempotency = R.curry((x,y) => R.compose(R.map(checkIfProcessed), readstorerepository.checkIdempotency(y))); | |
| return { | |
| checkIfProcessed, | |
| checkIdempotency | |
| } | |
| } | |
| this one works | |
| describe('#CHECKIFPROCESSED', function() { | |
| context('when calling with isIdepotence equal to true', function () { | |
| it('should return the data', function () { | |
| mut.checkIfProcessed({isIdempotent:true}).fork(null,x=> x.must.eql({isIdempotent:true})); | |
| }) | |
| }); | |
| }); | |
| obviously the below is in a state of confusion | |
| describe('#CHECKIFPROCESSED', function() { | |
| context('when calling with isIdepotence equal to true', function () { | |
| it('should return the data', function () { | |
| mut.checkIfProcessed({isIdempotent:true}).fork(null, ).must.eql(Future({isIdempotent:true})); | |
| }) | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment