mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-25 03:08:34 +00:00
* relocate .vscode
* Switch to transloadit linter
* Update .eslintrc.json
* autofix code
* unlink and install eslint-config-transloadit@1.1.1
* Change 0 to "off"
* Don't change 'use strict'
* Do not vertically align
* disable key-spacing
* add import/no-extraneous-dependencies per package
* add more react/a11y warnings
* Revert "autofix code"
This reverts commit 14c8a8cde8.
* add import/no-extraneous-dependencies per example and main package
* autofix code (2)
* Allow devDependencies in ./bin
* Change import/no-extraneous-dependencies to warn again
* upgrade linter
* Set import/no-extraneous-dependencies to warn
28 lines
789 B
JavaScript
28 lines
789 B
JavaScript
const settle = require('./settle')
|
|
|
|
describe('settle', () => {
|
|
it('should resolve even if all input promises reject', async () => {
|
|
await expect(
|
|
settle([
|
|
Promise.reject(new Error('oops')),
|
|
Promise.reject(new Error('this went wrong')),
|
|
])
|
|
).resolves.toMatchObject({
|
|
successful: [],
|
|
failed: [new Error('oops'), new Error('this went wrong')],
|
|
})
|
|
})
|
|
|
|
it('should resolve with an object if some input promises resolve', async () => {
|
|
await expect(
|
|
settle([
|
|
Promise.reject(new Error('rejected')),
|
|
Promise.resolve('resolved'),
|
|
Promise.resolve('also-resolved'),
|
|
])
|
|
).resolves.toMatchObject({
|
|
successful: ['resolved', 'also-resolved'],
|
|
failed: [new Error('rejected')],
|
|
})
|
|
})
|
|
})
|