aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/shared/checks.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-05-04 15:29:34 +0200
committerChocobozzz <chocobozzz@cpy.re>2023-05-09 08:57:34 +0200
commit5e47f6ab984a7d00782e4c7030afffa1ba480add (patch)
tree1ce586b591a8d71acbc301eba29b9a5e6490439e /server/tests/shared/checks.ts
parent6a4905602636afd6650c9e6f4d0fcc2105d91100 (diff)
downloadPeerTube-5e47f6ab984a7d00782e4c7030afffa1ba480add.tar.gz
PeerTube-5e47f6ab984a7d00782e4c7030afffa1ba480add.tar.zst
PeerTube-5e47f6ab984a7d00782e4c7030afffa1ba480add.zip
Support studio transcoding in peertube runner
Diffstat (limited to 'server/tests/shared/checks.ts')
-rw-r--r--server/tests/shared/checks.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/server/tests/shared/checks.ts b/server/tests/shared/checks.ts
index d7eb25bb5..feaef37c6 100644
--- a/server/tests/shared/checks.ts
+++ b/server/tests/shared/checks.ts
@@ -130,6 +130,22 @@ function checkBadSortPagination (url: string, path: string, token?: string, quer
130 }) 130 })
131} 131}
132 132
133// ---------------------------------------------------------------------------
134
135async function checkVideoDuration (server: PeerTubeServer, videoUUID: string, duration: number) {
136 const video = await server.videos.get({ id: videoUUID })
137
138 expect(video.duration).to.be.approximately(duration, 1)
139
140 for (const file of video.files) {
141 const metadata = await server.videos.getFileMetadata({ url: file.metadataUrl })
142
143 for (const stream of metadata.streams) {
144 expect(Math.round(stream.duration)).to.be.approximately(duration, 1)
145 }
146 }
147}
148
133export { 149export {
134 dateIsValid, 150 dateIsValid,
135 testImageSize, 151 testImageSize,
@@ -142,5 +158,6 @@ export {
142 checkBadStartPagination, 158 checkBadStartPagination,
143 checkBadCountPagination, 159 checkBadCountPagination,
144 checkBadSortPagination, 160 checkBadSortPagination,
161 checkVideoDuration,
145 expectLogContain 162 expectLogContain
146} 163}