-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
NAME
authored and
NAME
committed
Dec 7, 2016
1 parent
6c6cb9c
commit 1751499
Showing
11 changed files
with
191 additions
and
90 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
.idea/runConfigurations/Apollo.xml → .idea/runConfigurations/nodemon.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
File renamed without changes.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// | ||
// Copyright 2016 Minder Labs. | ||
// | ||
|
||
'use strict'; | ||
|
||
import { TypeUtil } from './type'; | ||
|
||
describe('Types:', () => { | ||
|
||
it ('zzz', (done) => { | ||
|
||
function f(i) { | ||
return new Promise((resolve, reject) => { | ||
console.log('A', i); | ||
resolve(); | ||
}).then(() => { | ||
console.log('B', i); | ||
}); | ||
} | ||
|
||
Promise.all([f(1), f(2)]) | ||
.then(() => { | ||
console.log('C'); | ||
done(); | ||
}); | ||
|
||
}); | ||
|
||
|
||
it('Iterator of promises.', (done) => { | ||
|
||
let values = []; | ||
|
||
// Async function. | ||
let f = (i) => { | ||
values.push(i); | ||
|
||
return Promise.resolve(i); | ||
}; | ||
|
||
TypeUtil.iterateWithPromises(_.times(5), (i) => { | ||
return f(i); | ||
|
||
}).then((value) => { | ||
|
||
// Last value. | ||
expect(value).to.equal(4); | ||
|
||
// Test done sequentially. | ||
expect(values.length).to.equal(5); | ||
|
||
done(); | ||
}); | ||
}); | ||
}); |
This file contains 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
This file contains 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