mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-16 16:37:12 +03:00
Fix getSkipSegmentsByHash requires valid json
The categories parameter has to be a valid array with strings in JSON format
This commit is contained in:
@@ -96,10 +96,10 @@ describe('getSegmentsByHash', () => {
|
||||
.catch(err => done("Couldn't call endpoint"));
|
||||
});
|
||||
|
||||
it('Should return 500 for bad format categories', (done: Done) => { // should probably be 400
|
||||
fetch(getbaseURL() + '/api/skipSegments/?categories=shilling')
|
||||
it('Should return 400 for bad format categories', (done: Done) => {
|
||||
fetch(getbaseURL() + '/api/skipSegments/fdaf?categories=shilling')
|
||||
.then(res => {
|
||||
if (res.status !== 500) done("expected 500 got " + res.status);
|
||||
if (res.status !== 400) done("expected 400 got " + res.status);
|
||||
else done(); // pass
|
||||
})
|
||||
.catch(err => done("Couldn't call endpoint"));
|
||||
|
||||
Reference in New Issue
Block a user