mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
14 lines
357 B
TypeScript
14 lines
357 B
TypeScript
import asyncPool = require('tiny-async-pool');
|
|
|
|
const expected = JSON.stringify(['A', 'B', 'C']);
|
|
|
|
asyncPool(5, ['a', 'b', 'c'], (value) => {
|
|
return new Promise((resolve) => {
|
|
resolve(value.toUpperCase);
|
|
});
|
|
}).then((results) => {
|
|
if (JSON.stringify(results) !== expected) {
|
|
throw new Error('Result is not equal to expected result!');
|
|
}
|
|
});
|