summaryrefslogtreecommitdiffstats
path: root/ui/src/api_tests/api.spec.ts
blob: f6dfb1614a0d77651bda4556ac99a37c2fa2b858 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import fetch from 'node-fetch';

test('adds 1 + 2 to equal 3', () => {
  let sum = (a: number, b: number) => a + b;
  expect(sum(1, 2)).toBe(3);
});

test('Get communism.lemmy.ml nodeinfo href', async () => {
  let url = 'https://communism.lemmy.ml/.well-known/nodeinfo';
  let href = 'https://communism.lemmy.ml/nodeinfo/2.0.json';
  let res = await fetch(url).then(d => d.json());
  expect(res.links.href).toBe(href);
});