refactor: add formatter to Playwright tests

This commit is contained in:
Elias Schneider
2025-06-27 23:33:26 +02:00
parent d070b9a778
commit 73e7e0b1c5
22 changed files with 1581 additions and 1764 deletions

View File

@@ -1,19 +1,17 @@
import playwrightConfig from "../playwright.config";
import playwrightConfig from '../playwright.config';
export async function cleanupBackend() {
const url = new URL("/api/test/reset", playwrightConfig.use!.baseURL);
const url = new URL('/api/test/reset', playwrightConfig.use!.baseURL);
if (process.env.SKIP_LDAP_TESTS === "true") {
url.searchParams.append("skip-ldap", "true");
}
if (process.env.SKIP_LDAP_TESTS === 'true') {
url.searchParams.append('skip-ldap', 'true');
}
const response = await fetch(url, {
method: "POST",
});
const response = await fetch(url, {
method: 'POST'
});
if (!response.ok) {
throw new Error(
`Failed to reset backend: ${response.status} ${response.statusText}`
);
}
if (!response.ok) {
throw new Error(`Failed to reset backend: ${response.status} ${response.statusText}`);
}
}