mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-19 05:58:32 +03:00
replace if tests with assert
This commit is contained in:
@@ -3,6 +3,7 @@ import {Done, getbaseURL} from '../utils';
|
||||
import {db} from '../../src/databases/databases';
|
||||
import {getHash} from '../../src/utils/getHash';
|
||||
import {IDatabase} from '../../src/databases/IDatabase';
|
||||
import assert from 'assert';
|
||||
|
||||
async function dbSponsorTimesAdd(db: IDatabase, videoID: string, startTime: number, endTime: number, UUID: string, category: string) {
|
||||
const votes = 0,
|
||||
@@ -57,7 +58,8 @@ describe('postPurgeAllSegments', function () {
|
||||
}),
|
||||
})
|
||||
.then(async res => {
|
||||
done(res.status === 403 ? undefined : res.status);
|
||||
assert.strictEqual(res.status, 403);
|
||||
done();
|
||||
})
|
||||
.catch(err => done(err));
|
||||
});
|
||||
@@ -74,7 +76,7 @@ describe('postPurgeAllSegments', function () {
|
||||
}),
|
||||
})
|
||||
.then(async res => {
|
||||
if (res.status !== 200) return done(`Status code was ${res.status}`);
|
||||
assert.strictEqual(res.status, 200);
|
||||
done(await dbSponsorTimesCompareExpect(db, 'vsegpurge01', 1) || await dbSponsorTimesCompareExpect(db, 'vseg-not-purged01', 0));
|
||||
})
|
||||
.catch(err => done(err));
|
||||
|
||||
Reference in New Issue
Block a user