testing CI

This commit is contained in:
Michael C 2021-07-14 14:11:34 -04:00
parent 5f2bc37e96
commit 8ee51a1cb0
No known key found for this signature in database
GPG key ID: FFB04FB3B878B7B4
2 changed files with 3 additions and 4 deletions

View file

@ -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)) {

View file

@ -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));