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]")
|
?.content.querySelectorAll("script[data-discourse-plugin]")
|
||||||
.forEach((script) => pluginNames.add(script.dataset.discoursePlugin));
|
.forEach((script) => pluginNames.add(script.dataset.discoursePlugin));
|
||||||
|
|
||||||
|
QUnit.config.urlConfig.push({
|
||||||
|
id: "loop",
|
||||||
|
label: "Loop until failure",
|
||||||
|
value: "1",
|
||||||
|
});
|
||||||
|
|
||||||
QUnit.config.urlConfig.push({
|
QUnit.config.urlConfig.push({
|
||||||
id: "target",
|
id: "target",
|
||||||
label: "Target",
|
label: "Target",
|
||||||
|
@ -356,6 +362,14 @@ export default function setupTests(config) {
|
||||||
QUnit.config.autostart = false;
|
QUnit.config.autostart = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getUrlParameter("loop")) {
|
||||||
|
QUnit.done(({ failed }) => {
|
||||||
|
if (failed === 0) {
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
handleLegacyParameters();
|
handleLegacyParameters();
|
||||||
|
|
||||||
const target = getUrlParameter("target") || "core";
|
const target = getUrlParameter("target") || "core";
|
||||||
|
|
Loading…
Reference in New Issue