fix types in tests

This commit is contained in:
Pujit Mehrotra
2025-10-08 12:50:00 -04:00
parent 2e8e4baa5a
commit c58199b3ed
2 changed files with 8 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { CpuPowerService } from '@app/unraid-api/graph/resolvers/info/cpu/cpu-power.service.js';
import { CpuService } from '@app/unraid-api/graph/resolvers/info/cpu/cpu.service.js';
vi.mock('systeminformation', () => ({
@@ -88,9 +89,14 @@ vi.mock('systeminformation', () => ({
describe('CpuService', () => {
let service: CpuService;
let cpuPowerService: CpuPowerService;
beforeEach(() => {
service = new CpuService();
cpuPowerService = {
generateCpuPower: vi.fn().mockResolvedValue({ id: 'info/cpu-power' }),
} as any;
service = new CpuService(cpuPowerService);
});
describe('generateCpu', () => {

View File

@@ -163,6 +163,7 @@ describe('MetricsResolver', () => {
const testModule = new MetricsResolver(
cpuService,
{} as any,
memoryService,
subscriptionTracker as any,
{} as any