mirror of
https://github.com/balzack/databag.git
synced 2025-03-13 00:50:03 +00:00
parent
09d4f03c54
commit
b12f7e2883
@ -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;
|
||||
|
@ -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);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user