mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-09 21:17:15 +03:00
testing CI
This commit is contained in:
@@ -25,7 +25,7 @@ const mergeLocks = (source: DBLock[]) => {
|
|||||||
const destMatch = dest.find(s => s.videoID === obj.videoID);
|
const destMatch = dest.find(s => s.videoID === obj.videoID);
|
||||||
if (destMatch) {
|
if (destMatch) {
|
||||||
// override longer reason
|
// 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
|
// push to categories
|
||||||
destMatch.categories.push(obj.category);
|
destMatch.categories.push(obj.category);
|
||||||
} else {
|
} else {
|
||||||
@@ -40,7 +40,6 @@ const mergeLocks = (source: DBLock[]) => {
|
|||||||
return dest;
|
return dest;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export async function getLockCategoriesByHash(req: Request, res: Response): Promise<Response> {
|
export async function getLockCategoriesByHash(req: Request, res: Response): Promise<Response> {
|
||||||
let hashPrefix = req.params.prefix as VideoIDHash;
|
let hashPrefix = req.params.prefix as VideoIDHash;
|
||||||
if (!hashPrefixTester(req.params.prefix)) {
|
if (!hashPrefixTester(req.params.prefix)) {
|
||||||
|
|||||||
@@ -106,10 +106,10 @@ describe("getSkipSegmentsByHash", () => {
|
|||||||
.catch(err => done(err));
|
.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"]`)
|
fetch(`${getbaseURL()}/api/skipSegments/?categories=["shilling"]`)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
assert.strictEqual(res.status, 404);
|
assert.strictEqual(res.status, 400);
|
||||||
done();
|
done();
|
||||||
})
|
})
|
||||||
.catch(err => done(err));
|
.catch(err => done(err));
|
||||||
|
|||||||
Reference in New Issue
Block a user