fixing unit test
Some checks are pending
CI / CI (push) Waiting to run

This commit is contained in:
balzack 2025-03-09 09:22:47 -07:00
parent 09d4f03c54
commit b12f7e2883
2 changed files with 6 additions and 4 deletions

View File

@ -1,7 +1,7 @@
import { EventEmitter } from 'eventemitter3';
import { Revision } from '../src/entities';
export class MockLink {
export class MockLinkModule {
private statusListener: ((status: string)=>Promise<void>) | null;
private messageListener: ((message: any)=>Promise<void>) | null;
private status: string;

View File

@ -1,5 +1,6 @@
import { Call } from '../src/types';
import { RingModule } from '../src/ring';
import { MockLink } from '../__mocks__/link';
import { MockLinkModule } from '../__mocks__/link';
import { waitFor } from '../__mocks__/waitFor';
import { ConsoleLogging } from '../src/logging';
@ -15,7 +16,7 @@ jest.mock('../src/net/fetchUtil', () => {
}
});
const mockLink = new MockLink();
const mockLink = new MockLinkModule();
jest.mock('../src/link', () => {
return {
Connection: jest.fn().mockImplementation(() => {
@ -25,10 +26,11 @@ jest.mock('../src/link', () => {
})
test('rings correctly', async () => {
const endContactCall = async (cardId: string, callId: string) => {
console.log("ending");
}
const log = new ConsoleLogging();
const ring = new RingModule(log, endContactCall);
const ringModule = new RingModule(log, endContactCall);
});