mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-01-11 06:12:42 +05:30
Fix Promise#finaly shim regression and cover with tests
This commit is contained in:
parent
c9254d0681
commit
ed41a98d3c
@ -1,6 +1,8 @@
|
|||||||
import 'babel-polyfill';
|
import 'babel-polyfill';
|
||||||
import 'whatwg-fetch';
|
import 'whatwg-fetch';
|
||||||
import 'promise.prototype.finally';
|
import { shim as shimPromiseFinaly } from 'promise.prototype.finally';
|
||||||
|
|
||||||
|
shimPromiseFinaly();
|
||||||
|
|
||||||
// allow :active styles in mobile Safary
|
// allow :active styles in mobile Safary
|
||||||
document.addEventListener('touchstart', () => {}, true);
|
document.addEventListener('touchstart', () => {}, true);
|
||||||
|
15
tests/polyfills.test.js
Normal file
15
tests/polyfills.test.js
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import expect from 'unexpected';
|
||||||
|
|
||||||
|
describe('promise.prototype.finally', () => {
|
||||||
|
it('should be invoked after promise resolved', () =>
|
||||||
|
expect(new Promise((resolve) => {
|
||||||
|
Promise.resolve().finally(resolve)
|
||||||
|
}), 'to be fulfilled')
|
||||||
|
);
|
||||||
|
|
||||||
|
it('should be invoked after promise rejected', () =>
|
||||||
|
expect(new Promise((resolve) => {
|
||||||
|
Promise.reject().finally(resolve)
|
||||||
|
}), 'to be fulfilled')
|
||||||
|
);
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user