summaryrefslogtreecommitdiffstats
path: root/ui/src/api_tests
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-04-23 11:34:32 -0400
committerDessalines <tyhou13@gmx.com>2020-04-23 11:34:32 -0400
commitce800f75adb651108e66d58bdc3e7755902f74ed (patch)
treee65e2824a7ae4136984c8b7785e899f359c708be /ui/src/api_tests
parentb8aaf5c1f175e0a68ee823e352b2608f5cef28dd (diff)
Adding a test bed for API testing. #658
Diffstat (limited to 'ui/src/api_tests')
-rw-r--r--ui/src/api_tests/api.spec.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/src/api_tests/api.spec.ts b/ui/src/api_tests/api.spec.ts
new file mode 100644
index 00000000..f6dfb161
--- /dev/null
+++ b/ui/src/api_tests/api.spec.ts
@@ -0,0 +1,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);
+});