mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-17 17:23:30 +03:00
Co-authored-by: Kyle Mendell <ksm@ofkm.us> Co-authored-by: Kyle Mendell <kmendell@ofkm.us> Co-authored-by: Elias Schneider <login@eliasschneider.com>
20 lines
468 B
TypeScript
20 lines
468 B
TypeScript
import playwrightConfig from "../playwright.config";
|
|
|
|
export async function cleanupBackend() {
|
|
const url = new URL("/api/test/reset", playwrightConfig.use!.baseURL);
|
|
|
|
if (process.env.SKIP_LDAP_TESTS === "true") {
|
|
url.searchParams.append("skip-ldap", "true");
|
|
}
|
|
|
|
const response = await fetch(url, {
|
|
method: "POST",
|
|
});
|
|
|
|
if (!response.ok) {
|
|
throw new Error(
|
|
`Failed to reset backend: ${response.status} ${response.statusText}`
|
|
);
|
|
}
|
|
}
|