Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test helpers 2 electric boogaloo #562

Draft
wants to merge 32 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ecbf809
postPurgeAllSegments, setUsername
mchangrh Oct 16, 2023
db28400
use more test helpers
mchangrh Oct 16, 2023
430ac8c
use gha native services
mchangrh Oct 16, 2023
b7f9423
add setUsername ban test
mchangrh Oct 16, 2023
7c4838c
half-broken getLockCategoriesByHash
mchangrh Oct 16, 2023
625dc43
replace done()
mchangrh Oct 17, 2023
afb39ba
fix missing HashedVideoID
mchangrh Oct 17, 2023
355c154
fix typos
mchangrh Oct 17, 2023
6a08de7
userAgentTest from array
mchangrh Oct 17, 2023
5ec0018
use queryGen, userGen
mchangrh Oct 17, 2023
7a76628
refactor getRandom to genRandom
mchangrh Oct 17, 2023
f7e0980
getSegmetInfo tests
mchangrh Oct 17, 2023
9238cc5
merge 404 clauses in getSegmentInfo
mchangrh Oct 17, 2023
db94918
simplify getSegmentInfo endpoint with parseParams
mchangrh Oct 17, 2023
4e51293
use ES5 proxies instead of arrays
mchangrh Oct 17, 2023
fe3f742
rewrite tests for voteOnSponsorTime
mchangrh Oct 17, 2023
ae4e670
add undovote tests
mchangrh Oct 17, 2023
c4161a7
add category vote tests
mchangrh Oct 17, 2023
f729585
use variables, 1 vote for categories
mchangrh Oct 17, 2023
aa90b6a
less votes for category re-flipping
mchangrh Oct 24, 2023
b29dea2
convert more functions
mchangrh Oct 24, 2023
bc191ea
add getUserInfoFree
mchangrh Nov 3, 2023
c664d83
update getSearchSegment, fix parseParams
mchangrh Nov 4, 2023
d7a4b67
update tests
mchangrh Nov 4, 2023
88a7435
add more small tests
mchangrh Nov 4, 2023
2969266
postSkipSegments, postSkipSegmentsLocked
mchangrh Nov 21, 2023
e393708
getSkipSegments tests
mchangrh Dec 12, 2023
be3490a
partial skipsegments byhash rewrite
mchangrh Dec 15, 2023
30f8693
insomnia fueled tests
mchangrh Dec 16, 2023
28a457c
test checkpoint
mchangrh Dec 21, 2023
94cd59e
finish getSkipSegmentsByHash test
mchangrh Dec 26, 2023
5062bef
Merge branch 'master' of github.com:ajayyy/SponsorBlockServer into te…
mchangrh May 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test checkpoint
mchangrh committed Dec 21, 2023
commit 28a457ca29cb724a22062a9225d575e25f0e9e36
43 changes: 2 additions & 41 deletions test/cases/getSkipSegmentsByHash.ts
Original file line number Diff line number Diff line change
@@ -237,48 +237,9 @@ describe("getSkipSegmentsByHash", () => {
assert.strictEqual(retreive.data[0].segments.length, 1);
});

it("Should be able to get multiple categories with repeating parameters", (done) => {
client.get(`${endpoint}/${hashedVideoIDs[0].hashedVideoID.substring(0,7)}?&category=sponsor&category=intro`)
.then(res => {
assert.strictEqual(res.status, 200);
const data = (res.data as Array<any>).sort((a, b) => a.videoID.localeCompare(b.videoID));
assert.strictEqual(data.length, 1);
const expected = [{
segments: [{
segment: [1, 10],
category: "sponsor",
UUID: "getSegmentsByHash-01",
}, {
segment: [20, 30],
category: "intro",
UUID: "getSegmentsByHash-03",
}]
}];
assert.ok(partialDeepEquals(data, expected));
done();
})
.catch(err => done(err));
});

it("Should be able to get specific segments with requiredSegments", (done) => {
it("Should be able to get specific segments with requiredSegments", () => {
const prefix = requiredSegmentVidHash.substring(0, 5);
client.get(`${endpoint}/${prefix}?requiredSegments=["requiredSegmentsVid-2","requiredSegmentsVid-3"]`)
.then(res => {
assert.strictEqual(res.status, 200);
const data = (res.data as Array<any>).sort((a, b) => a.videoID.localeCompare(b.videoID));
assert.strictEqual(data.length, 1);
const expected = [{
segments: [{
UUID: "requiredSegmentsVid-2"
}, {
UUID: "requiredSegmentsVid-3"
}]
}];
assert.ok(partialDeepEquals(data, expected));
assert.strictEqual(data[0].segments.length, 2);
done();
})
.catch(err => done(err));
return assertSegmentsEqual(prefix, ["requiredSegmentsVid-2", "requiredSegmentsVid-3"], { params: { requiredSegments: `["requiredSegmentsVid-2","requiredSegmentsVid-3"]` } });
});

it("Should be able to get specific segments with repeating requiredSegment", (done) => {