mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
feat(tests): add frontend automated testing setup with Vitest and jsdom
This commit is contained in:
16
tests/frontend/setup.js
Normal file
16
tests/frontend/setup.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { afterEach, beforeEach } from 'vitest';
|
||||
|
||||
beforeEach(() => {
|
||||
// Ensure storage is clean before each test to avoid cross-test pollution
|
||||
localStorage.clear();
|
||||
sessionStorage.clear();
|
||||
|
||||
// Reset DOM state for modules that rely on body attributes
|
||||
document.body.innerHTML = '';
|
||||
document.body.dataset.page = '';
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
// Clean any dynamically attached globals by tests
|
||||
delete document.body.dataset.page;
|
||||
});
|
||||
Reference in New Issue
Block a user