From b77c0a57cc089a554ee874ae9ff5ff53e6b5eb99 Mon Sep 17 00:00:00 2001 From: Pitu Date: Mon, 4 Jan 2021 00:48:34 +0900 Subject: feat: add testing capabilities --- src/tests/api/verify.test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/tests/api/verify.test.js (limited to 'src/tests/api/verify.test.js') 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); + } +}); -- cgit v1.2.3