DEV: Add "loop until failure" feature to QUnit (#24545)
This commit is contained in:
parent
1f2a25331b
commit
e98ac4736e
|
@ -139,6 +139,12 @@ function setupToolbar() {
|
|||
?.content.querySelectorAll("script[data-discourse-plugin]")
|
||||
.forEach((script) => pluginNames.add(script.dataset.discoursePlugin));
|
||||
|
||||
QUnit.config.urlConfig.push({
|
||||
id: "loop",
|
||||
label: "Loop until failure",
|
||||
value: "1",
|
||||
});
|
||||
|
||||
QUnit.config.urlConfig.push({
|
||||
id: "target",
|
||||
label: "Target",
|
||||
|
@ -356,6 +362,14 @@ export default function setupTests(config) {
|
|||
QUnit.config.autostart = false;
|
||||
}
|
||||
|
||||
if (getUrlParameter("loop")) {
|
||||
QUnit.done(({ failed }) => {
|
||||
if (failed === 0) {
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
handleLegacyParameters();
|
||||
|
||||
const target = getUrlParameter("target") || "core";
|
||||
|
|
Loading…
Reference in New Issue