aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/fixtures/peertube-plugin-test-four/main.js7
-rw-r--r--server/tests/plugins/plugin-helpers.ts17
2 files changed, 24 insertions, 0 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test-four/main.js b/server/tests/fixtures/peertube-plugin-test-four/main.js
index edbb883e2..bff42ff40 100644
--- a/server/tests/fixtures/peertube-plugin-test-four/main.js
+++ b/server/tests/fixtures/peertube-plugin-test-four/main.js
@@ -111,6 +111,13 @@ async function register ({
111 111
112 return res.json(details) 112 return res.json(details)
113 }) 113 })
114
115 router.get('/ffprobe', async (req, res) => {
116 const result = await peertubeHelpers.videos.ffprobe(req.query.path)
117 if (!result) return res.sendStatus(404)
118
119 return res.json(result)
120 })
114 } 121 }
115 122
116} 123}
diff --git a/server/tests/plugins/plugin-helpers.ts b/server/tests/plugins/plugin-helpers.ts
index 26f66b0b1..da84658bb 100644
--- a/server/tests/plugins/plugin-helpers.ts
+++ b/server/tests/plugins/plugin-helpers.ts
@@ -224,6 +224,7 @@ describe('Test plugin helpers', function () {
224 224
225 describe('Videos', function () { 225 describe('Videos', function () {
226 let videoUUID: string 226 let videoUUID: string
227 let videoPath: string
227 228
228 before(async () => { 229 before(async () => {
229 this.timeout(240000) 230 this.timeout(240000)
@@ -260,6 +261,8 @@ describe('Test plugin helpers', function () {
260 await makeRawRequest(file.url, HttpStatusCode.OK_200) 261 await makeRawRequest(file.url, HttpStatusCode.OK_200)
261 } 262 }
262 } 263 }
264
265 videoPath = body.webtorrent.videoFiles[0].path
263 } 266 }
264 267
265 // Thumbnails check 268 // Thumbnails check
@@ -278,6 +281,20 @@ describe('Test plugin helpers', function () {
278 } 281 }
279 }) 282 })
280 283
284 it('Should probe a file', async function () {
285 const { body } = await makeGetRequest({
286 url: servers[0].url,
287 path: '/plugins/test-four/router/ffprobe',
288 query: {
289 path: videoPath
290 },
291 expectedStatus: HttpStatusCode.OK_200
292 })
293
294 expect(body.streams).to.be.an('array')
295 expect(body.streams).to.have.lengthOf(2)
296 })
297
281 it('Should remove a video after a view', async function () { 298 it('Should remove a video after a view', async function () {
282 this.timeout(40000) 299 this.timeout(40000)
283 300