mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 09:07:47 +01:00
testing CI
This commit is contained in:
parent
5f2bc37e96
commit
8ee51a1cb0
2 changed files with 3 additions and 4 deletions
|
@ -25,7 +25,7 @@ const mergeLocks = (source: DBLock[]) => {
|
|||
const destMatch = dest.find(s => s.videoID === obj.videoID);
|
||||
if (destMatch) {
|
||||
// override longer reason
|
||||
if (obj.reason.length > destMatch.reason.length) destMatch.reason = obj.reason;
|
||||
if (obj.reason?.length > destMatch.reason?.length) destMatch.reason = obj.reason;
|
||||
// push to categories
|
||||
destMatch.categories.push(obj.category);
|
||||
} else {
|
||||
|
@ -40,7 +40,6 @@ const mergeLocks = (source: DBLock[]) => {
|
|||
return dest;
|
||||
};
|
||||
|
||||
|
||||
export async function getLockCategoriesByHash(req: Request, res: Response): Promise<Response> {
|
||||
let hashPrefix = req.params.prefix as VideoIDHash;
|
||||
if (!hashPrefixTester(req.params.prefix)) {
|
||||
|
|
|
@ -106,10 +106,10 @@ describe("getSkipSegmentsByHash", () => {
|
|||
.catch(err => done(err));
|
||||
});
|
||||
|
||||
it("Should return 404 for no hash", (done: Done) => {
|
||||
it("Should return 400 for no hash", (done: Done) => {
|
||||
fetch(`${getbaseURL()}/api/skipSegments/?categories=["shilling"]`)
|
||||
.then(res => {
|
||||
assert.strictEqual(res.status, 404);
|
||||
assert.strictEqual(res.status, 400);
|
||||
done();
|
||||
})
|
||||
.catch(err => done(err));
|
||||
|
|
Loading…
Reference in a new issue