Skip to content

Commit 8742fe0

Browse files
WezSieTatoCopilot
andauthored
Fix: cache removing
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 5d41705 commit 8742fe0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

test/popup.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ beforeEach(() => {
2020
global.chrome = chromeMock;
2121

2222
// Clear module cache so popup/pola.js re-executes with fresh mocks
23-
const popupPath = path.resolve(__dirname, '..', 'popup', 'pola.js');
24-
delete require.cache[popupPath];
23+
const popupModulePath = require.resolve('../popup/pola.js');
24+
delete require.cache[popupModulePath];
2525

2626
// Load the module (it exports Pola class instead of instantiating it in test env)
27-
Pola = require('../popup/pola.js').Pola;
27+
Pola = require(popupModulePath).Pola;
2828
});
2929

3030
afterEach(() => {

0 commit comments

Comments
 (0)