mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-03-29 18:56:36 +00:00
refactor: add formatter to Playwright tests
This commit is contained in:
@@ -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}`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user