You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
910 B
24 lines
910 B
import { describe, expect, it } from 'vitest' |
|
import { buildProfileReportsRelayUrls } from './profile-reports-relays' |
|
|
|
describe('buildProfileReportsRelayUrls', () => { |
|
it('uses inbox, http-index, and cache layers only', () => { |
|
const urls = buildProfileReportsRelayUrls( |
|
{ |
|
read: ['wss://inbox.example.com/'], |
|
httpRead: ['https://index.example.com/'], |
|
write: ['wss://outbox.example.com/'] |
|
}, |
|
[], |
|
{ |
|
includeAuthorLocalRelays: true, |
|
cacheRelayUrls: ['ws://127.0.0.1:4869/'] |
|
} |
|
) |
|
expect(urls.some((u) => u.includes('inbox.example.com'))).toBe(true) |
|
expect(urls.some((u) => u.includes('index.example.com'))).toBe(true) |
|
expect(urls.some((u) => u.includes('127.0.0.1'))).toBe(true) |
|
expect(urls.some((u) => u.includes('outbox.example.com'))).toBe(false) |
|
expect(urls.some((u) => u.includes('damus'))).toBe(false) |
|
}) |
|
})
|
|
|