X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Fbenchmark.ts;h=4a414a2fa1e734af0dc686e064235edc09db1896;hb=428025432b111dcee90ba4a47eeaac8b03f4c4f6;hp=37c74013189190314021a8210237f0a624595f6d;hpb=4e5e072c1b2f40f76a0df1b66a4a6949c42641df;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/benchmark.ts b/scripts/benchmark.ts index 37c740131..4a414a2fa 100644 --- a/scripts/benchmark.ts +++ b/scripts/benchmark.ts @@ -55,7 +55,7 @@ async function run () { path: '/accounts/peertube', headers: buildAPHeader(), expecter: (body, status) => { - return status === 200 && body.startsWith('{"type":') + return status === 200 && body.startsWith('{"@context":') } }, { @@ -63,7 +63,7 @@ async function run () { path: '/videos/watch/' + video.uuid, headers: buildAPHeader(), expecter: (body, status) => { - return status === 200 && body.startsWith('{"type":"Video"') + return status === 200 && body.startsWith('{"@context":') } }, { @@ -153,21 +153,23 @@ async function run () { } }, { - title: 'API - watching', + title: 'API - views with token', method: 'PUT', headers: { ...buildAuthorizationHeader(), ...buildJSONHeader() }, body: JSON.stringify({ currentTime: 2 }), - path: '/api/v1/videos/' + video.uuid + '/watching', + path: '/api/v1/videos/' + video.uuid + '/views', expecter: (body, status) => { return status === 204 } }, { - title: 'API - views', + title: 'API - views without token', method: 'POST', + headers: buildJSONHeader(), + body: JSON.stringify({ currentTime: 2 }), path: '/api/v1/videos/' + video.uuid + '/views', expecter: (body, status) => { return status === 204