mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-09 00:28:51 +00:00
final adjustments and now even the flaky tests that depend on others's relay should pass most of the time.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { test, expect } from 'bun:test'
|
||||
import { test, expect, afterAll } from 'bun:test'
|
||||
|
||||
import { finishEvent, type Event } from './event.ts'
|
||||
import { generatePrivateKey, getPublicKey } from './keys.ts'
|
||||
@@ -8,6 +8,10 @@ let pool = new SimplePool()
|
||||
|
||||
let relays = ['wss://relay.damus.io/', 'wss://relay.nostr.bg/', 'wss://nos.lol', 'wss://public.relaying.io']
|
||||
|
||||
afterAll(() => {
|
||||
pool.close([...relays, 'wss://offchain.pub', 'wss://eden.nostr.land'])
|
||||
})
|
||||
|
||||
test('removing duplicates when querying', async () => {
|
||||
let priv = generatePrivateKey()
|
||||
let pub = getPublicKey(priv)
|
||||
@@ -33,7 +37,6 @@ test('removing duplicates when querying', async () => {
|
||||
)
|
||||
|
||||
await Promise.any(pool.publish(relays, event))
|
||||
|
||||
await new Promise(resolve => setTimeout(resolve, 1500))
|
||||
|
||||
expect(received).toHaveLength(1)
|
||||
|
||||
Reference in New Issue
Block a user