mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-13 06:57:05 +03:00
add 400 conditions
This commit is contained in:
@@ -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));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user