8 lines
223 B
JavaScript
8 lines
223 B
JavaScript
|
/* useful for timing promises when jest fakeTimers are not reliable enough */
|
||
|
export default timeout =>
|
||
|
new Promise(resolve => {
|
||
|
jest.useRealTimers();
|
||
|
setTimeout(resolve, timeout);
|
||
|
jest.useFakeTimers();
|
||
|
});
|