mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-27 23:50:36 +08:00
We change the instructions to connect to a local node to use the simplified authentication flow. Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
39 lines
1.2 KiB
TypeScript
39 lines
1.2 KiB
TypeScript
import * as FsSync from "node:fs";
|
|
import * as Path from "node:path";
|
|
import { describe, test } from "vitest";
|
|
|
|
import { HttpdClient } from "@httpd-client";
|
|
import { authenticate } from "@httpd-client/tests/support/httpd.js";
|
|
import { createPeerManager } from "@tests/support/peerManager.js";
|
|
import { gitOptions } from "@tests/support/fixtures.js";
|
|
import { tmpDir } from "@tests/support/support.js";
|
|
|
|
describe("session", async () => {
|
|
const peerManager = await createPeerManager({
|
|
dataDir: Path.resolve(Path.join(tmpDir, "peers")),
|
|
outputLog: FsSync.createWriteStream(
|
|
Path.join(tmpDir, "peerManager.log"),
|
|
).setMaxListeners(16),
|
|
});
|
|
const peer = await peerManager.createPeer({
|
|
name: "session",
|
|
gitOptions: gitOptions["alice"],
|
|
});
|
|
await peer.startHttpd();
|
|
const api = new HttpdClient(peer.httpdBaseUrl);
|
|
|
|
test("#getById(id)", async () => {
|
|
const id = await authenticate(api, peer);
|
|
await api.session.getById(id);
|
|
});
|
|
|
|
test("#update(id, {sig, pk})", async () => {
|
|
await authenticate(api, peer);
|
|
});
|
|
|
|
test("#delete(id)", async () => {
|
|
const id = await authenticate(api, peer);
|
|
await api.session.delete(id);
|
|
});
|
|
});
|