aboutsummaryrefslogtreecommitdiff
path: root/src/tests/api
diff options
context:
space:
mode:
authorPitu <[email protected]>2021-01-04 00:48:34 +0900
committerPitu <[email protected]>2021-01-04 00:48:34 +0900
commitb77c0a57cc089a554ee874ae9ff5ff53e6b5eb99 (patch)
tree3f53f464b09a439958389bbd3652ebb66b33a4af /src/tests/api
parentUpdate migration (diff)
downloadhost.fuwn.me-b77c0a57cc089a554ee874ae9ff5ff53e6b5eb99.tar.xz
host.fuwn.me-b77c0a57cc089a554ee874ae9ff5ff53e6b5eb99.zip
feat: add testing capabilities
Diffstat (limited to 'src/tests/api')
-rw-r--r--src/tests/api/verify.test.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tests/api/verify.test.js b/src/tests/api/verify.test.js
new file mode 100644
index 0000000..34bc45e
--- /dev/null
+++ b/src/tests/api/verify.test.js
@@ -0,0 +1,12 @@
+/* eslint-disable no-undef */
+import { axios } from '../utils';
+
+// This should never succeed as we are not passing a token. We are expecting a 401
+test('Verify token', async () => {
+ try {
+ await axios.get('/api/verify');
+ expect(true).toBe(false);
+ } catch (err) {
+ expect(err.response.status).toBe(401);
+ }
+});