refactor: use fetch cache arg instead of cache busting (#3584)

This commit is contained in:
Erez Rokah
2020-04-21 17:46:06 +03:00
committed by GitHub
parent 9b79623bc8
commit 8f1b325809
147 changed files with 70994 additions and 51781 deletions

View File

@ -21,7 +21,17 @@ const retrieveRecordedExpectations = async () => {
.then(resolve, reject);
});
let recorded = await promise;
let timeout;
const timeoutPromise = new Promise(resolve => {
timeout = setTimeout(() => {
console.warn('retrieveRecordedExpectations timeout');
resolve([]);
}, 3000);
});
let recorded = await Promise.race([promise, timeoutPromise]);
clearTimeout(timeout);
recorded = recorded.filter(({ httpRequest }) => {
const { Host = [] } = httpRequest.headers;