1 /* tslint:disable:no-unused-expression */
3 import * as chai from 'chai'
4 import { keyBy } from 'lodash'
6 import { join } from 'path'
7 import * as request from 'supertest'
17 getVideosListPagination,
25 searchVideoWithPagination,
28 setAccessTokensToServers,
35 import { viewVideo } from '../utils/videos'
37 const expect = chai.expect
39 describe('Test a single server', function () {
40 let server: ServerInfo = null
43 let videosListBase: any[] = null
45 before(async function () {
50 server = await runServer(1)
52 await setAccessTokensToServers([ server ])
55 it('Should list video categories', async function () {
56 const res = await getVideoCategories(server.url)
58 const categories = res.body
59 expect(Object.keys(categories)).to.have.length.above(10)
61 expect(categories[11]).to.equal('News')
64 it('Should list video licences', async function () {
65 const res = await getVideoLicences(server.url)
67 const licences = res.body
68 expect(Object.keys(licences)).to.have.length.above(5)
70 expect(licences[3]).to.equal('Attribution - No Derivatives')
73 it('Should list video languages', async function () {
74 const res = await getVideoLanguages(server.url)
76 const languages = res.body
77 expect(Object.keys(languages)).to.have.length.above(5)
79 expect(languages[3]).to.equal('Mandarin')
82 it('Should list video privacies', async function () {
83 const res = await getVideoPrivacies(server.url)
85 const privacies = res.body
86 expect(Object.keys(privacies)).to.have.length.at.least(3)
88 expect(privacies[3]).to.equal('Private')
91 it('Should not have videos', async function () {
92 const res = await getVideosList(server.url)
94 expect(res.body.total).to.equal(0)
95 expect(res.body.data).to.be.an('array')
96 expect(res.body.data.length).to.equal(0)
99 it('Should upload the video', async function () {
100 const videoAttributes = {
101 name: 'my super name',
105 tags: [ 'tag1', 'tag2', 'tag3' ]
107 const res = await uploadVideo(server.url, server.accessToken, videoAttributes)
108 expect(res.body.video).to.not.be.undefined
109 expect(res.body.video.id).to.equal(1)
110 expect(res.body.video.uuid).to.have.length.above(5)
113 it('Should seed the uploaded video', async function () {
114 // Yes, this could be long
117 const res = await getVideosList(server.url)
119 expect(res.body.total).to.equal(1)
120 expect(res.body.data).to.be.an('array')
121 expect(res.body.data.length).to.equal(1)
123 const video = res.body.data[0]
124 expect(video.name).to.equal('my super name')
125 expect(video.category).to.equal(2)
126 expect(video.categoryLabel).to.equal('Films')
127 expect(video.licence).to.equal(6)
128 expect(video.licenceLabel).to.equal('Attribution - Non Commercial - No Derivatives')
129 expect(video.language).to.equal(3)
130 expect(video.languageLabel).to.equal('Mandarin')
131 expect(video.nsfw).to.be.ok
132 expect(video.description).to.equal('my super description')
133 expect(video.serverHost).to.equal('localhost:9001')
134 expect(video.accountName).to.equal('root')
135 expect(video.isLocal).to.be.true
136 expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'tag3' ])
137 expect(dateIsValid(video.createdAt)).to.be.true
138 expect(dateIsValid(video.updatedAt)).to.be.true
140 const res2 = await getVideo(server.url, res.body.data[0].id)
141 const videoDetails = res2.body
143 expect(videoDetails.files).to.have.lengthOf(1)
145 const file = videoDetails.files[0]
146 const magnetUri = file.magnetUri
147 expect(file.magnetUri).to.have.lengthOf.above(2)
148 expect(file.torrentUrl).to.equal(`${server.url}/static/torrents/${videoDetails.uuid}-${file.resolution}.torrent`)
149 expect(file.fileUrl).to.equal(`${server.url}/static/webseed/${videoDetails.uuid}-${file.resolution}.webm`)
150 expect(file.resolution).to.equal(720)
151 expect(file.resolutionLabel).to.equal('720p')
152 expect(file.size).to.equal(218910)
154 const test = await testVideoImage(server.url, 'video_short.webm', videoDetails.thumbnailPath)
155 expect(test).to.equal(true)
157 videoId = videoDetails.id
158 videoUUID = videoDetails.uuid
160 const torrent = await webtorrentAdd(magnetUri)
161 expect(torrent.files).to.be.an('array')
162 expect(torrent.files.length).to.equal(1)
163 expect(torrent.files[0].path).to.exist.and.to.not.equal('')
166 it('Should get the video', async function () {
167 // Yes, this could be long
170 const res = await getVideo(server.url, videoId)
172 const video = res.body
173 expect(video.name).to.equal('my super name')
174 expect(video.category).to.equal(2)
175 expect(video.categoryLabel).to.equal('Films')
176 expect(video.licence).to.equal(6)
177 expect(video.licenceLabel).to.equal('Attribution - Non Commercial - No Derivatives')
178 expect(video.language).to.equal(3)
179 expect(video.languageLabel).to.equal('Mandarin')
180 expect(video.nsfw).to.be.ok
181 expect(video.description).to.equal('my super description')
182 expect(video.serverHost).to.equal('localhost:9001')
183 expect(video.accountName).to.equal('root')
184 expect(video.isLocal).to.be.true
185 expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'tag3' ])
186 expect(dateIsValid(video.createdAt)).to.be.true
187 expect(dateIsValid(video.updatedAt)).to.be.true
188 expect(video.channel.name).to.equal('Default root channel')
189 expect(video.channel.isLocal).to.be.true
190 expect(dateIsValid(video.channel.createdAt)).to.be.true
191 expect(dateIsValid(video.channel.updatedAt)).to.be.true
193 expect(video.files).to.have.lengthOf(1)
195 const file = video.files[0]
196 expect(file.magnetUri).to.have.lengthOf.above(2)
197 expect(file.resolution).to.equal(720)
198 expect(file.resolutionLabel).to.equal('720p')
199 expect(file.size).to.equal(218910)
201 const test = await testVideoImage(server.url, 'video_short.webm', video.thumbnailPath)
202 expect(test).to.equal(true)
204 // Wait the async views increment
208 it('Should get the video by UUID', async function () {
209 // Yes, this could be long
212 const res = await getVideo(server.url, videoUUID)
214 const video = res.body
215 expect(video.name).to.equal('my super name')
217 // Wait the async views increment
221 it('Should have the views updated', async function () {
222 await viewVideo(server.url, videoId)
223 await viewVideo(server.url, videoId)
224 await viewVideo(server.url, videoId)
226 const res = await getVideo(server.url, videoId)
228 const video = res.body
229 expect(video.views).to.equal(3)
232 it('Should search the video by name', async function () {
233 const res = await searchVideo(server.url, 'my')
235 expect(res.body.total).to.equal(1)
236 expect(res.body.data).to.be.an('array')
237 expect(res.body.data.length).to.equal(1)
239 const video = res.body.data[0]
240 expect(video.name).to.equal('my super name')
241 expect(video.category).to.equal(2)
242 expect(video.categoryLabel).to.equal('Films')
243 expect(video.licence).to.equal(6)
244 expect(video.licenceLabel).to.equal('Attribution - Non Commercial - No Derivatives')
245 expect(video.language).to.equal(3)
246 expect(video.languageLabel).to.equal('Mandarin')
247 expect(video.nsfw).to.be.ok
248 expect(video.description).to.equal('my super description')
249 expect(video.serverHost).to.equal('localhost:9001')
250 expect(video.accountName).to.equal('root')
251 expect(video.isLocal).to.be.true
252 expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'tag3' ])
253 expect(dateIsValid(video.createdAt)).to.be.true
254 expect(dateIsValid(video.updatedAt)).to.be.true
256 const test = await testVideoImage(server.url, 'video_short.webm', video.thumbnailPath)
257 expect(test).to.equal(true)
260 // Not implemented yet
261 // it('Should search the video by serverHost', async function () {
262 // const res = await videosUtils.searchVideo(server.url, '9001', 'host')
264 // expect(res.body.total).to.equal(1)
265 // expect(res.body.data).to.be.an('array')
266 // expect(res.body.data.length).to.equal(1)
268 // const video = res.body.data[0]
269 // expect(video.name).to.equal('my super name')
270 // expect(video.description).to.equal('my super description')
271 // expect(video.serverHost).to.equal('localhost:9001')
272 // expect(video.author).to.equal('root')
273 // expect(video.isLocal).to.be.true
274 // expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'tag3' ])
275 // expect(dateIsValid(video.createdAt)).to.be.true
276 // expect(dateIsValid(video.updatedAt)).to.be.true
278 // const test = await testVideoImage(server.url, 'video_short.webm', video.thumbnailPath)
279 // expect(test).to.equal(true)
286 // Not implemented yet
287 // it('Should search the video by tag', async function () {
288 // const res = await searchVideo(server.url, 'tag1')
290 // expect(res.body.total).to.equal(1)
291 // expect(res.body.data).to.be.an('array')
292 // expect(res.body.data.length).to.equal(1)
294 // const video = res.body.data[0]
295 // expect(video.name).to.equal('my super name')
296 // expect(video.category).to.equal(2)
297 // expect(video.categoryLabel).to.equal('Films')
298 // expect(video.licence).to.equal(6)
299 // expect(video.licenceLabel).to.equal('Attribution - Non Commercial - No Derivatives')
300 // expect(video.language).to.equal(3)
301 // expect(video.languageLabel).to.equal('Mandarin')
302 // expect(video.nsfw).to.be.ok
303 // expect(video.description).to.equal('my super description')
304 // expect(video.serverHost).to.equal('localhost:9001')
305 // expect(video.accountName).to.equal('root')
306 // expect(video.isLocal).to.be.true
307 // expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'tag3' ])
308 // expect(dateIsValid(video.createdAt)).to.be.true
309 // expect(dateIsValid(video.updatedAt)).to.be.true
311 // const test = await testVideoImage(server.url, 'video_short.webm', video.thumbnailPath)
312 // expect(test).to.equal(true)
315 it('Should not find a search by name', async function () {
316 const res = await searchVideo(server.url, 'hello')
318 expect(res.body.total).to.equal(0)
319 expect(res.body.data).to.be.an('array')
320 expect(res.body.data.length).to.equal(0)
323 // Not implemented yet
324 // it('Should not find a search by author', async function () {
325 // const res = await searchVideo(server.url, 'hello')
327 // expect(res.body.total).to.equal(0)
328 // expect(res.body.data).to.be.an('array')
329 // expect(res.body.data.length).to.equal(0)
332 // Not implemented yet
333 // it('Should not find a search by tag', async function () {
334 // const res = await searchVideo(server.url, 'hello')
336 // expect(res.body.total).to.equal(0)
337 // expect(res.body.data).to.be.an('array')
338 // expect(res.body.data.length).to.equal(0)
341 it('Should remove the video', async function () {
342 await removeVideo(server.url, server.accessToken, videoId)
344 const files1 = await readdirPromise(join(__dirname, '..', '..', '..', 'test1/videos/'))
345 expect(files1).to.have.lengthOf(0)
347 const files2 = await readdirPromise(join(__dirname, '..', '..', '..', 'test1/thumbnails/'))
348 expect(files2).to.have.lengthOf(0)
351 it('Should not have videos', async function () {
352 const res = await getVideosList(server.url)
354 expect(res.body.total).to.equal(0)
355 expect(res.body.data).to.be.an('array')
356 expect(res.body.data).to.have.lengthOf(0)
359 it('Should upload 6 videos', async function () {
363 'video_short.mp4', 'video_short.ogv', 'video_short.webm',
364 'video_short1.webm', 'video_short2.webm', 'video_short3.webm'
367 // const tasks: Promise<any>[] = []
368 for (const video of videos) {
369 const videoAttributes = {
370 name: video + ' name',
371 description: video + ' description',
376 tags: [ 'tag1', 'tag2', 'tag3' ],
380 const p = uploadVideo(server.url, server.accessToken, videoAttributes)
383 // FIXME: concurrent uploads does not work :(
387 // await Promise.all(tasks)
390 it('Should have the correct durations', async function () {
391 const res = await getVideosList(server.url)
393 expect(res.body.total).to.equal(6)
394 const videos = res.body.data
395 expect(videos).to.be.an('array')
396 expect(videos).to.have.lengthOf(6)
398 const videosByName = keyBy<{ duration: number }>(videos, 'name')
399 expect(videosByName['video_short.mp4 name'].duration).to.equal(5)
400 expect(videosByName['video_short.ogv name'].duration).to.equal(5)
401 expect(videosByName['video_short.webm name'].duration).to.equal(5)
402 expect(videosByName['video_short1.webm name'].duration).to.equal(10)
403 expect(videosByName['video_short2.webm name'].duration).to.equal(5)
404 expect(videosByName['video_short3.webm name'].duration).to.equal(5)
407 it('Should have the correct thumbnails', async function () {
408 const res = await getVideosList(server.url)
410 const videos = res.body.data
412 videosListBase = videos
414 for (const video of videos) {
415 const videoName = video.name.replace(' name', '')
416 const test = await testVideoImage(server.url, videoName, video.thumbnailPath)
418 expect(test).to.equal(true)
422 it('Should list only the two first videos', async function () {
423 const res = await getVideosListPagination(server.url, 0, 2, 'name')
425 const videos = res.body.data
426 expect(res.body.total).to.equal(6)
427 expect(videos.length).to.equal(2)
428 expect(videos[0].name).to.equal(videosListBase[0].name)
429 expect(videos[1].name).to.equal(videosListBase[1].name)
432 it('Should list only the next three videos', async function () {
433 const res = await getVideosListPagination(server.url, 2, 3, 'name')
435 const videos = res.body.data
436 expect(res.body.total).to.equal(6)
437 expect(videos.length).to.equal(3)
438 expect(videos[0].name).to.equal(videosListBase[2].name)
439 expect(videos[1].name).to.equal(videosListBase[3].name)
440 expect(videos[2].name).to.equal(videosListBase[4].name)
443 it('Should list the last video', async function () {
444 const res = await getVideosListPagination(server.url, 5, 6, 'name')
446 const videos = res.body.data
447 expect(res.body.total).to.equal(6)
448 expect(videos.length).to.equal(1)
449 expect(videos[0].name).to.equal(videosListBase[5].name)
452 it('Should search the first video', async function () {
453 const res = await searchVideoWithPagination(server.url, 'webm', 0, 1, 'name')
455 const videos = res.body.data
456 expect(res.body.total).to.equal(4)
457 expect(videos.length).to.equal(1)
458 expect(videos[0].name).to.equal('video_short1.webm name')
461 it('Should search the last two videos', async function () {
462 const res = await searchVideoWithPagination(server.url, 'webm', 2, 2, 'name')
464 const videos = res.body.data
465 expect(res.body.total).to.equal(4)
466 expect(videos.length).to.equal(2)
467 expect(videos[0].name).to.equal('video_short3.webm name')
468 expect(videos[1].name).to.equal('video_short.webm name')
471 it('Should search all the webm videos', async function () {
472 const res = await searchVideoWithPagination(server.url, 'webm', 0, 15)
474 const videos = res.body.data
475 expect(res.body.total).to.equal(4)
476 expect(videos.length).to.equal(4)
479 // Not implemented yet
480 // it('Should search all the root author videos', async function () {
481 // const res = await searchVideoWithPagination(server.url, 'root', 0, 15)
483 // const videos = res.body.data
484 // expect(res.body.total).to.equal(6)
485 // expect(videos.length).to.equal(6)
488 // Not implemented yet
489 // it('Should search all the 9001 port videos', async function () {
490 // const res = await videosUtils.searchVideoWithPagination(server.url, '9001', 'host', 0, 15)
492 // const videos = res.body.data
493 // expect(res.body.total).to.equal(6)
494 // expect(videos.length).to.equal(6)
500 // it('Should search all the localhost videos', async function () {
501 // const res = await videosUtils.searchVideoWithPagination(server.url, 'localhost', 'host', 0, 15)
503 // const videos = res.body.data
504 // expect(res.body.total).to.equal(6)
505 // expect(videos.length).to.equal(6)
511 it('Should list and sort by name in descending order', async function () {
512 const res = await getVideosListSort(server.url, '-name')
514 const videos = res.body.data
515 expect(res.body.total).to.equal(6)
516 expect(videos.length).to.equal(6)
517 expect(videos[0].name).to.equal('video_short.webm name')
518 expect(videos[1].name).to.equal('video_short.ogv name')
519 expect(videos[2].name).to.equal('video_short.mp4 name')
520 expect(videos[3].name).to.equal('video_short3.webm name')
521 expect(videos[4].name).to.equal('video_short2.webm name')
522 expect(videos[5].name).to.equal('video_short1.webm name')
525 it('Should search and sort by name in ascending order', async function () {
526 const res = await searchVideoWithSort(server.url, 'webm', 'name')
528 const videos = res.body.data
529 expect(res.body.total).to.equal(4)
530 expect(videos.length).to.equal(4)
532 expect(videos[0].name).to.equal('video_short1.webm name')
533 expect(videos[1].name).to.equal('video_short2.webm name')
534 expect(videos[2].name).to.equal('video_short3.webm name')
535 expect(videos[3].name).to.equal('video_short.webm name')
537 videoId = videos[2].id
540 it('Should update a video', async function () {
542 name: 'my super video updated',
547 description: 'my super description updated',
548 tags: [ 'tagup1', 'tagup2' ]
550 await updateVideo(server.url, server.accessToken, videoId, attributes)
553 it('Should have the video updated', async function () {
556 const res = await getVideo(server.url, videoId)
558 const video = res.body
560 expect(video.name).to.equal('my super video updated')
561 expect(video.category).to.equal(4)
562 expect(video.categoryLabel).to.equal('Art')
563 expect(video.licence).to.equal(2)
564 expect(video.licenceLabel).to.equal('Attribution - Share Alike')
565 expect(video.language).to.equal(5)
566 expect(video.languageLabel).to.equal('Arabic')
567 expect(video.nsfw).to.be.ok
568 expect(video.description).to.equal('my super description updated')
569 expect(video.serverHost).to.equal('localhost:9001')
570 expect(video.accountName).to.equal('root')
571 expect(video.account.name).to.equal('root')
572 expect(video.isLocal).to.be.true
573 expect(video.tags).to.deep.equal([ 'tagup1', 'tagup2' ])
574 expect(dateIsValid(video.createdAt)).to.be.true
575 expect(dateIsValid(video.updatedAt)).to.be.true
577 expect(video.channel.name).to.equal('Default root channel')
578 expect(video.channel.isLocal).to.be.true
579 expect(dateIsValid(video.channel.createdAt)).to.be.true
580 expect(dateIsValid(video.channel.updatedAt)).to.be.true
582 expect(video.files).to.have.lengthOf(1)
584 const file = video.files[0]
585 const magnetUri = file.magnetUri
586 expect(file.magnetUri).to.have.lengthOf.above(2)
587 expect(file.resolution).to.equal(720)
588 expect(file.resolutionLabel).to.equal('720p')
589 expect(file.size).to.equal(292677)
591 const test = await testVideoImage(server.url, 'video_short3.webm', video.thumbnailPath)
592 expect(test).to.equal(true)
594 const torrent = await webtorrentAdd(magnetUri)
595 expect(torrent.files).to.be.an('array')
596 expect(torrent.files.length).to.equal(1)
597 expect(torrent.files[0].path).to.exist.and.to.not.equal('')
600 it('Should update only the tags of a video', async function () {
602 tags: [ 'tag1', 'tag2', 'supertag' ]
605 await updateVideo(server.url, server.accessToken, videoId, attributes)
607 const res = await getVideo(server.url, videoId)
608 const video = res.body
610 expect(video.name).to.equal('my super video updated')
611 expect(video.category).to.equal(4)
612 expect(video.categoryLabel).to.equal('Art')
613 expect(video.licence).to.equal(2)
614 expect(video.licenceLabel).to.equal('Attribution - Share Alike')
615 expect(video.language).to.equal(5)
616 expect(video.languageLabel).to.equal('Arabic')
617 expect(video.nsfw).to.be.ok
618 expect(video.description).to.equal('my super description updated')
619 expect(video.serverHost).to.equal('localhost:9001')
620 expect(video.accountName).to.equal('root')
621 expect(video.isLocal).to.be.true
622 expect(video.tags).to.deep.equal([ 'supertag', 'tag1', 'tag2' ])
623 expect(dateIsValid(video.createdAt)).to.be.true
624 expect(dateIsValid(video.updatedAt)).to.be.true
626 expect(video.channel.name).to.equal('Default root channel')
627 expect(video.channel.isLocal).to.be.true
628 expect(dateIsValid(video.channel.createdAt)).to.be.true
629 expect(dateIsValid(video.channel.updatedAt)).to.be.true
631 expect(video.files).to.have.lengthOf(1)
633 const file = video.files[0]
634 expect(file.magnetUri).to.have.lengthOf.above(2)
635 expect(file.resolution).to.equal(720)
636 expect(file.resolutionLabel).to.equal('720p')
637 expect(file.size).to.equal(292677)
640 it('Should update only the description of a video', async function () {
642 description: 'hello everybody'
645 await updateVideo(server.url, server.accessToken, videoId, attributes)
647 const res = await getVideo(server.url, videoId)
648 const video = res.body
650 expect(video.name).to.equal('my super video updated')
651 expect(video.category).to.equal(4)
652 expect(video.categoryLabel).to.equal('Art')
653 expect(video.licence).to.equal(2)
654 expect(video.licenceLabel).to.equal('Attribution - Share Alike')
655 expect(video.language).to.equal(5)
656 expect(video.languageLabel).to.equal('Arabic')
657 expect(video.nsfw).to.be.ok
658 expect(video.description).to.equal('hello everybody')
659 expect(video.serverHost).to.equal('localhost:9001')
660 expect(video.accountName).to.equal('root')
661 expect(video.isLocal).to.be.true
662 expect(video.tags).to.deep.equal([ 'supertag', 'tag1', 'tag2' ])
663 expect(dateIsValid(video.createdAt)).to.be.true
664 expect(dateIsValid(video.updatedAt)).to.be.true
666 expect(video.channel.name).to.equal('Default root channel')
667 expect(video.channel.isLocal).to.be.true
668 expect(dateIsValid(video.channel.createdAt)).to.be.true
669 expect(dateIsValid(video.channel.updatedAt)).to.be.true
671 expect(video.files).to.have.lengthOf(1)
673 const file = video.files[0]
674 expect(file.magnetUri).to.have.lengthOf.above(2)
675 expect(file.resolution).to.equal(720)
676 expect(file.resolutionLabel).to.equal('720p')
677 expect(file.size).to.equal(292677)
680 it('Should like a video', async function () {
681 await rateVideo(server.url, server.accessToken, videoId, 'like')
683 const res = await getVideo(server.url, videoId)
684 const video = res.body
686 expect(video.likes).to.equal(1)
687 expect(video.dislikes).to.equal(0)
690 it('Should dislike the same video', async function () {
691 await rateVideo(server.url, server.accessToken, videoId, 'dislike')
693 const res = await getVideo(server.url, videoId)
694 const video = res.body
696 expect(video.likes).to.equal(0)
697 expect(video.dislikes).to.equal(1)
700 it('Should upload a video with minimum parameters', async function () {
701 const path = '/api/v1/videos/upload'
703 const req = request(server.url)
705 .set('Accept', 'application/json')
706 .set('Authorization', 'Bearer ' + server.accessToken)
707 .field('name', 'minimum parameters')
708 .field('privacy', '1')
709 .field('nsfw', 'false')
710 .field('channelId', '1')
712 const filePath = join(__dirname, '..', 'api', 'fixtures', 'video_short.webm')
714 await req.attach('videofile', filePath)
717 const res = await getVideosList(server.url)
718 const video = res.body.data.find(v => v.name === 'minimum parameters')
720 expect(video.name).to.equal('minimum parameters')
721 expect(video.category).to.equal(null)
722 expect(video.categoryLabel).to.equal('Misc')
723 expect(video.licence).to.equal(null)
724 expect(video.licenceLabel).to.equal('Unknown')
725 expect(video.language).to.equal(null)
726 expect(video.languageLabel).to.equal('Unknown')
727 expect(video.nsfw).to.not.be.ok
728 expect(video.description).to.equal(null)
729 expect(video.serverHost).to.equal('localhost:9001')
730 expect(video.accountName).to.equal('root')
731 expect(video.isLocal).to.be.true
732 expect(video.tags).to.deep.equal([ ])
733 expect(dateIsValid(video.createdAt)).to.be.true
734 expect(dateIsValid(video.updatedAt)).to.be.true
737 after(async function () {
738 killallServers([ server ])
740 // Keep the logs if the test failed