@@ -76,13 +76,13 @@ test('Async Resolved', t => {
76
76
} )
77
77
78
78
test ( 'Async fromPromise' , t => {
79
- const resProm = x => new Promise ( ( res , _ ) => res ( x ) )
79
+ const resProm = x => new Promise ( ( res ) => res ( x ) )
80
80
81
81
t . ok ( isFunction ( Async . fromPromise ) , 'is a function' )
82
82
t . ok ( isFunction ( Async . fromPromise ( resProm ) ) , 'returns a function' )
83
83
84
84
const fn = bindFunc ( Async . fromPromise )
85
- const fork = bindFunc ( x => Async . fromPromise ( _ => x ) ( ) . fork ( noop , noop ) )
85
+ const fork = bindFunc ( x => Async . fromPromise ( ( ) => x ) ( ) . fork ( noop , noop ) )
86
86
87
87
t . throws ( fn ( undefined ) , TypeError , 'throws with undefined' )
88
88
t . throws ( fn ( null ) , TypeError , 'throws with null' )
@@ -116,7 +116,7 @@ test('Async fromPromise resolution', t => {
116
116
const val = 'super fun'
117
117
118
118
const rejProm = x => new Promise ( ( _ , rej ) => rej ( x ) )
119
- const resProm = x => new Promise ( ( res , _ ) => res ( x ) )
119
+ const resProm = x => new Promise ( ( res ) => res ( x ) )
120
120
121
121
const rej = y => x => t . equal ( x , y , 'rejects a rejected Promise' )
122
122
const res = y => x => t . equal ( x , y , 'resolves a resolved Promise' )
@@ -228,7 +228,7 @@ test('Async type', t => {
228
228
229
229
test ( 'Async fork' , t => {
230
230
const resolved = Async ( ( _ , res ) => res ( 'resolved' ) )
231
- const rejected = Async ( ( rej , _ ) => rej ( 'rejected' ) )
231
+ const rejected = Async ( ( rej ) => rej ( 'rejected' ) )
232
232
233
233
const res = sinon . spy ( identity )
234
234
const rej = sinon . spy ( identity )
@@ -305,7 +305,7 @@ test('Async swap', t => {
305
305
t . throws ( fn ( noop , { } ) , TypeError , 'throws with object in right' )
306
306
t . throws ( fn ( noop , [ ] ) , TypeError , 'throws with array in right' )
307
307
308
- const rejected = Async ( ( rej , _ ) => rej ( 'silly' ) ) . swap ( constant ( 'was rejected' ) , identity )
308
+ const rejected = Async ( ( rej ) => rej ( 'silly' ) ) . swap ( constant ( 'was rejected' ) , identity )
309
309
const resolved = Async ( ( _ , res ) => res ( 'silly' ) ) . swap ( identity , constant ( 'was resolved' ) )
310
310
311
311
const rej = sinon . spy ( )
@@ -346,7 +346,7 @@ test('Async coalesce', t => {
346
346
t . throws ( fn ( noop , { } ) , TypeError , 'throws with object in right' )
347
347
t . throws ( fn ( noop , [ ] ) , TypeError , 'throws with array in right' )
348
348
349
- const rejected = Async ( ( rej , _ ) => rej ( ) ) . coalesce ( constant ( 'was rejected' ) , identity )
349
+ const rejected = Async ( ( rej ) => rej ( ) ) . coalesce ( constant ( 'was rejected' ) , identity )
350
350
const resolved = Async ( ( _ , res ) => res ( ) ) . coalesce ( identity , constant ( 'was resolved' ) )
351
351
352
352
const rej = sinon . spy ( )
@@ -384,8 +384,8 @@ test('Async map errors', t => {
384
384
test ( 'Async map functionality' , t => {
385
385
const mapFn = sinon . spy ( )
386
386
387
- const rejected = Async ( ( rej , _ ) => rej ( 'rejected' ) ) . map ( mapFn ) . fork ( noop , noop )
388
- const resolved = Async ( ( _ , res ) => res ( 'resolved' ) ) . map ( mapFn ) . fork ( noop , noop )
387
+ Async ( ( rej ) => rej ( 'rejected' ) ) . map ( mapFn ) . fork ( noop , noop )
388
+ Async ( ( _ , res ) => res ( 'resolved' ) ) . map ( mapFn ) . fork ( noop , noop )
389
389
390
390
t . equal ( Async ( noop ) . map ( noop ) . type ( ) , 'Async' , 'returns an Async' )
391
391
t . ok ( mapFn . calledWith ( 'resolved' ) , 'calls map function on resolved' )
@@ -455,7 +455,7 @@ test('Async bimap functionality', t => {
455
455
const rej = sinon . spy ( )
456
456
const res = sinon . spy ( )
457
457
458
- Async ( ( rej , _ ) => rej ( 'rejected' ) ) . bimap ( left , right ) . fork ( rej , res )
458
+ Async ( ( rej ) => rej ( 'rejected' ) ) . bimap ( left , right ) . fork ( rej , res )
459
459
Async ( ( _ , res ) => res ( 'resolved' ) ) . bimap ( left , right ) . fork ( rej , res )
460
460
461
461
t . equal ( Async ( noop ) . bimap ( noop , noop ) . type ( ) , 'Async' , 'returns an Async' )
@@ -714,8 +714,10 @@ test('Async chain properties (Chain)', t => {
714
714
const f = x => Async ( ( _ , res ) => res ( x + 2 ) )
715
715
const g = x => Async ( ( _ , res ) => res ( x + 10 ) )
716
716
717
- const a = x => Async ( ( _ , res ) => res ( x ) ) . chain ( f ) . chain ( g ) . fork ( noop , aRes )
718
- const b = x => Async ( ( _ , res ) => res ( x ) ) . chain ( y => f ( y ) . chain ( g ) ) . fork ( noop , bRes )
717
+ const x = 12
718
+
719
+ Async ( ( _ , res ) => res ( x ) ) . chain ( f ) . chain ( g ) . fork ( noop , aRes )
720
+ Async ( ( _ , res ) => res ( x ) ) . chain ( y => f ( y ) . chain ( g ) ) . fork ( noop , bRes )
719
721
720
722
t . same ( aRes . args [ 0 ] , bRes . args [ 0 ] , 'assosiativity' )
721
723
@@ -728,16 +730,16 @@ test('Async chain properties (Monad)', t => {
728
730
729
731
const f = x => Async ( ( _ , res ) => res ( x ) )
730
732
731
- aLeft = sinon . spy ( )
732
- bLeft = sinon . spy ( )
733
+ const aLeft = sinon . spy ( )
734
+ const bLeft = sinon . spy ( )
733
735
734
736
Async . of ( 3 ) . chain ( f ) . fork ( noop , aLeft )
735
737
f ( 3 ) . fork ( noop , bLeft )
736
738
737
739
t . same ( aLeft . args [ 0 ] , bLeft . args [ 0 ] , 'left identity' )
738
740
739
- aRight = sinon . spy ( )
740
- bRight = sinon . spy ( )
741
+ const aRight = sinon . spy ( )
742
+ const bRight = sinon . spy ( )
741
743
742
744
f ( 3 ) . chain ( Async . of ) . fork ( noop , aRight )
743
745
f ( 3 ) . fork ( noop , bRight )
0 commit comments