Merge pull request #161 from ajayyy/testing

Testing
This commit is contained in:
Ajay Ramachandran
2020-10-11 13:36:41 -04:00
committed by GitHub
2 changed files with 4 additions and 7 deletions

View File

@@ -40,14 +40,15 @@ describe('getSegmentsByHash', () => {
});
});
it('Should be able to get a 404 if no videos', (done) => {
it('Should be able to get an empty array if no videos', (done) => {
request.get(utils.getbaseURL()
+ '/api/skipSegments/11111?categories=["shilling"]', null,
(err, res, body) => {
if (err) done("Couldn't call endpoint");
else if (res.statusCode !== 404) done("non 404 status code, was " + res.statusCode);
else {
done(); // pass
if (JSON.parse(body).length === 0 && body === '[]') done(); // pass
else done("non empty array returned");
}
});
});