refactor: speed up retryingTest (#59542)

This commit is contained in:
Oliver Eyton-Williams
2025-04-07 19:17:29 +02:00
committed by GitHub
parent 7da7dc034e
commit 9b8d3b7a6a
8 changed files with 8 additions and 8 deletions
@@ -35,7 +35,7 @@ const retryingTest = (test, message, tries = 20) => {
retryingTest(test, message, tries - 1)
.then(resolve)
.catch(reject);
}, 100);
}, 1);
});
};
() => retryingTest(() => document.querySelector('img'), "'img' element not found");
@@ -37,7 +37,7 @@ const retryingTest = (test, message, tries = 20) => {
retryingTest(test, message, tries - 1)
.then(resolve)
.catch(reject);
}, 100);
}, 1);
});
};
() => retryingTest(() => document.querySelector('p'), "'p' element not found");
@@ -37,7 +37,7 @@ const retryingTest = (test, message, tries = 20) => {
retryingTest(test, message, tries - 1)
.then(resolve)
.catch(reject);
}, 100);
}, 1);
});
};
() => retryingTest(() => document.querySelector('a'), "'a' element not found");
@@ -37,7 +37,7 @@ const retryingTest = (test, message, tries = 20) => {
retryingTest(test, message, tries - 1)
.then(resolve)
.catch(reject);
}, 100);
}, 1);
});
};
() => retryingTest(() => document.querySelector('p')?.previousElementSibling?.tagName === 'DIV', "'div' element not found");
@@ -29,7 +29,7 @@ const retryingTest = (test, message, tries = 20) => {
retryingTest(test, message, tries - 1)
.then(resolve)
.catch(reject);
}, 100);
}, 1);
});
};
() => retryingTest(() => document.querySelector('img'), "'img' element not found");
@@ -31,7 +31,7 @@ const retryingTest = (test, message, tries = 20) => {
retryingTest(test, message, tries - 1)
.then(resolve)
.catch(reject);
}, 100);
}, 1);
});
};
() => retryingTest(() => document.querySelector('p'), "'p' element not found");
@@ -31,7 +31,7 @@ const retryingTest = (test, message, tries = 20) => {
retryingTest(test, message, tries - 1)
.then(resolve)
.catch(reject);
}, 100);
}, 1);
});
};
() => retryingTest(() => document.querySelector('a'), "'a' element not found");
@@ -31,7 +31,7 @@ const retryingTest = (test, message, tries = 20) => {
retryingTest(test, message, tries - 1)
.then(resolve)
.catch(reject);
}, 100);
}, 1);
});
};
() => retryingTest(() => document.querySelector('p')?.previousElementSibling?.tagName === 'DIV', "'div' element not found");