Files
pubky-core/pubky/pkg/test/http.js
2024-09-25 22:50:52 +03:00

27 lines
499 B
JavaScript

import test from 'tape'
import { PubkyClient, Keypair, PublicKey } from '../index.cjs'
const TLD = '8pinxxgqs41n4aididenw5apqp1urfmzdztr8jt4abrkdn435ewo';
// TODO: test HTTPs too somehow.
test("basic fetch", async (t) => {
let client = PubkyClient.testnet();
// Normal TLD
{
let response = await client.fetch(`http://relay.pkarr.org/`);
t.equal(response.status, 200);
}
// Pubky
let response = await client.fetch(`http://${TLD}/`);
t.equal(response.status, 200);
})