call useWebSocketImplementation() on relay and pool tests.
This commit is contained in:
parent
01f13292bb
commit
62e5730965
|
@ -2,7 +2,10 @@ import { afterEach, beforeEach, expect, test } from 'bun:test'
|
|||
|
||||
import { SimplePool } from './pool.ts'
|
||||
import { finalizeEvent, generateSecretKey, getPublicKey, type Event } from './pure.ts'
|
||||
import { MockRelay } from './test-helpers.ts'
|
||||
import { useWebSocketImplementation } from './relay.ts'
|
||||
import { MockRelay, MockWebSocketClient } from './test-helpers.ts'
|
||||
|
||||
useWebSocketImplementation(MockWebSocketClient)
|
||||
|
||||
let pool: SimplePool
|
||||
let mockRelays: MockRelay[]
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import { expect, test } from 'bun:test'
|
||||
|
||||
import { finalizeEvent, generateSecretKey, getPublicKey } from './pure.ts'
|
||||
import { Relay } from './relay.ts'
|
||||
import { MockRelay } from './test-helpers.ts'
|
||||
import { Relay, useWebSocketImplementation } from './relay.ts'
|
||||
import { MockRelay, MockWebSocketClient } from './test-helpers.ts'
|
||||
|
||||
useWebSocketImplementation(MockWebSocketClient)
|
||||
|
||||
test('connectivity', async () => {
|
||||
const mockRelay = new MockRelay()
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import { Server } from 'mock-socket'
|
||||
import { Server, WebSocket } from 'mock-socket'
|
||||
|
||||
import { finalizeEvent, type Event, getPublicKey, generateSecretKey } from './pure.ts'
|
||||
import { matchFilters, type Filter } from './filter.ts'
|
||||
|
||||
export const MockWebSocketClient = WebSocket
|
||||
|
||||
export function buildEvent(params: Partial<Event>): Event {
|
||||
return {
|
||||
id: '',
|
||||
|
|
Loading…
Reference in New Issue