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,7 +1,7 @@
// Copyright (c) 2026 Gordon Bolton. MIT License.
const RTorrentClient = require('../../../server/clients/RTorrentClient');
const xmlrpc = require('xmlrpc');
const { vi } = require('vitest');
import RTorrentClient from '../../../server/clients/RTorrentClient.js';
import xmlrpc from 'xmlrpc';
import { vi } from 'vitest';
vi.mock('xmlrpc', () => ({
createClient: vi.fn()