fix: convert test files to ES modules and fix qbittorrent test method calls
Some checks failed
Build and Push Docker Image / build (push) Successful in 37s
Licence Check / Licence compatibility and copyright header verification (push) Successful in 45s
CI / Security audit (push) Successful in 1m3s
CI / Tests & coverage (push) Failing after 1m18s

- Convert all client test files from CommonJS require() to ES module import syntax
- Convert downloadClients.test.js and integration/downloadClients.test.js to ES modules
- Fix qbittorrent.test.js to use getActiveDownloads() instead of getTorrents()
- All test files now use proper Vitest-compatible ES module syntax
- Resolves Vitest import errors and QBittorrentClient method call errors
This commit is contained in:
2026-05-19 12:19:04 +01:00
parent cc0e34b3d1
commit 5342170ced
7 changed files with 28 additions and 28 deletions

View File

@@ -1,11 +1,11 @@
// Copyright (c) 2026 Gordon Bolton. MIT License.
const {
import {
initializeClients,
getAllDownloads,
getDownloadsByClientType,
testAllConnections
} = require('../../server/utils/downloadClients');
const { vi } = require('vitest');
} from '../../server/utils/downloadClients.js';
import { vi } from 'vitest';
// Mock environment variables for testing
process.env.SABNZBD_INSTANCES = JSON.stringify([