add 400 conditions

This commit is contained in:
Michael C
2021-07-10 16:30:30 -04:00
parent 596dbf4ac8
commit e8d0da3ce3
7 changed files with 47 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ import fetch from 'node-fetch';
import {Done, getbaseURL} from '../utils';
import {db} from '../../src/databases/databases';
import {getHash} from '../../src/utils/getHash';
import assert from 'assert';
describe('getUserID', () => {
before(async () => {
@@ -398,4 +399,13 @@ describe('getUserID', () => {
})
.catch(() => ("couldn't call endpoint"));
});
it('should return 400 if no username parameter specified', (done: Done) => {
fetch(getbaseURL() + '/api/userID')
.then(res => {
assert.strictEqual(res.status, 400);
done();
})
.catch(() => ("couldn't call endpoint"));
});
});