Files
AdGuardHome/client/tests/e2e/globalTeardown.ts
Igor Lobanov 225167a8bb cleanup
2025-02-05 11:35:42 +01:00

17 lines
449 B
TypeScript

import { existsSync, renameSync, unlinkSync } from 'fs';
import { CONFIG_FILE, TEMP_CONFIG_FILE } from './globalSetup';
async function globalTeardown() {
// Remove the test config file
if (existsSync(CONFIG_FILE)) {
unlinkSync(CONFIG_FILE);
}
// Restore the original config file if it exists
if (existsSync(TEMP_CONFIG_FILE)) {
renameSync(TEMP_CONFIG_FILE, CONFIG_FILE);
}
}
export default globalTeardown;