Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

646 B
Raw Blame
import assert from 'node:assert/strict'
import test from 'node:test'
import { relayAddressToSave } from './relay-address.ts'

test('a typed relay address is stored only when it changes', () => {
  assert.equal(relayAddressToSave('  https://relay.example.com/  ', 'https://relay.example.com'), null)
  assert.equal(relayAddressToSave('https://relay.example.com///', 'https://relay.example.com'), null)
  assert.equal(relayAddressToSave('   ', null), null)
  assert.equal(relayAddressToSave('https://other.example', 'https://relay.example.com'), 'https://other.example')
  assert.equal(relayAddressToSave('  ', 'https://relay.example.com'), '')
})