We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2f43830 commit a4d2709Copy full SHA for a4d2709
server/tests/auth.test.js
@@ -63,6 +63,18 @@ describe('## Auth APIs', () => {
63
.catch(done);
64
});
65
66
+ it('should fail to get random number because of wrong token', (done) => {
67
+ request(app)
68
+ .get('/api/auth/random-number')
69
+ .set('Authorization', 'Bearer inValidToken')
70
+ .expect(httpStatus.UNAUTHORIZED)
71
+ .then((res) => {
72
+ expect(res.body.message).to.equal('Unauthorized');
73
+ done();
74
+ })
75
+ .catch(done);
76
+ });
77
+
78
it('should get a random number', (done) => {
79
request(app)
80
.get('/api/auth/random-number')
0 commit comments