From fbcfccda01aa02472634cf1d6c526a57b08d41a9 Mon Sep 17 00:00:00 2001 From: Sepehr Safari Date: Sat, 20 Jan 2024 11:31:18 +0330 Subject: [PATCH] update nip42.test.ts with new mock relay class --- nip42.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nip42.test.ts b/nip42.test.ts index 270fd79..53f8f9d 100644 --- a/nip42.test.ts +++ b/nip42.test.ts @@ -2,15 +2,15 @@ import { expect, test } from 'bun:test' import { makeAuthEvent } from './nip42.ts' import { Relay } from './relay.ts' -import { newMockRelay } from './test-helpers.ts' +import { MockRelay } from './test-helpers.ts' test('auth flow', async () => { - const { url } = newMockRelay() - const relay = await Relay.connect(url) + const mockRelay = new MockRelay() + const relay = await Relay.connect(mockRelay.getUrl()) const auth = makeAuthEvent(relay.url, 'chachacha') expect(auth.tags).toHaveLength(2) - expect(auth.tags[0]).toEqual(['relay', url]) + expect(auth.tags[0]).toEqual(['relay', mockRelay.getUrl()]) expect(auth.tags[1]).toEqual(['challenge', 'chachacha']) expect(auth.kind).toEqual(22242) })