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

@@ -3,6 +3,7 @@ import {Done, getbaseURL} from '../utils';
import {db} from '../../src/databases/databases';
import {getHash} from '../../src/utils/getHash';
import {IDatabase} from '../../src/databases/IDatabase';
import assert from 'assert';
async function dbSponsorTimesAdd(db: IDatabase, videoID: string, startTime: number, endTime: number, UUID: string, category: string) {
const votes = 0,
@@ -79,4 +80,18 @@ describe('postPurgeAllSegments', function () {
})
.catch(err => done(err));
});
it('Should return 400 if missing body', function (done: Done) {
fetch(`${baseURL}${route}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
}
})
.then(async res => {
assert.strictEqual(res.status, 400);
done();
})
.catch(err => done(err));
});
});