diff options
Diffstat (limited to 'shared/extra-utils')
-rw-r--r-- | shared/extra-utils/miscs/generate.ts | 2 | ||||
-rw-r--r-- | shared/extra-utils/miscs/webtorrent.ts | 2 | ||||
-rw-r--r-- | shared/extra-utils/mock-servers/mock-email.ts | 3 | ||||
-rw-r--r-- | shared/extra-utils/mock-servers/mock-instances-index.ts | 2 | ||||
-rw-r--r-- | shared/extra-utils/mock-servers/mock-joinpeertube-versions.ts | 2 | ||||
-rw-r--r-- | shared/extra-utils/mock-servers/mock-object-storage.ts | 2 | ||||
-rw-r--r-- | shared/extra-utils/mock-servers/mock-plugin-blocklist.ts | 4 | ||||
-rw-r--r-- | shared/extra-utils/mock-servers/mock-proxy.ts | 2 | ||||
-rw-r--r-- | shared/extra-utils/requests/requests.ts | 2 | ||||
-rw-r--r-- | shared/extra-utils/videos/captions.ts | 2 | ||||
-rw-r--r-- | shared/extra-utils/videos/live.ts | 8 |
11 files changed, 15 insertions, 16 deletions
diff --git a/shared/extra-utils/miscs/generate.ts b/shared/extra-utils/miscs/generate.ts index a03a20049..3b29c0ad4 100644 --- a/shared/extra-utils/miscs/generate.ts +++ b/shared/extra-utils/miscs/generate.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { expect } from 'chai' | 1 | import { expect } from 'chai' |
2 | import * as ffmpeg from 'fluent-ffmpeg' | 2 | import ffmpeg from 'fluent-ffmpeg' |
3 | import { ensureDir, pathExists } from 'fs-extra' | 3 | import { ensureDir, pathExists } from 'fs-extra' |
4 | import { dirname } from 'path' | 4 | import { dirname } from 'path' |
5 | import { getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution } from '@server/helpers/ffprobe-utils' | 5 | import { getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution } from '@server/helpers/ffprobe-utils' |
diff --git a/shared/extra-utils/miscs/webtorrent.ts b/shared/extra-utils/miscs/webtorrent.ts index a1097effe..8fe2ad821 100644 --- a/shared/extra-utils/miscs/webtorrent.ts +++ b/shared/extra-utils/miscs/webtorrent.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { readFile } from 'fs-extra' | 1 | import { readFile } from 'fs-extra' |
2 | import * as parseTorrent from 'parse-torrent' | 2 | import parseTorrent from 'parse-torrent' |
3 | import { basename, join } from 'path' | 3 | import { basename, join } from 'path' |
4 | import * as WebTorrent from 'webtorrent' | 4 | import * as WebTorrent from 'webtorrent' |
5 | import { VideoFile } from '@shared/models' | 5 | import { VideoFile } from '@shared/models' |
diff --git a/shared/extra-utils/mock-servers/mock-email.ts b/shared/extra-utils/mock-servers/mock-email.ts index ffd62e325..c13d3dc0f 100644 --- a/shared/extra-utils/mock-servers/mock-email.ts +++ b/shared/extra-utils/mock-servers/mock-email.ts | |||
@@ -1,9 +1,8 @@ | |||
1 | import { ChildProcess } from 'child_process' | 1 | import { ChildProcess } from 'child_process' |
2 | import MailDev from 'maildev' | ||
2 | import { randomInt } from '@shared/core-utils' | 3 | import { randomInt } from '@shared/core-utils' |
3 | import { parallelTests } from '../miscs' | 4 | import { parallelTests } from '../miscs' |
4 | 5 | ||
5 | const MailDev = require('maildev') | ||
6 | |||
7 | class MockSmtpServer { | 6 | class MockSmtpServer { |
8 | 7 | ||
9 | private static instance: MockSmtpServer | 8 | private static instance: MockSmtpServer |
diff --git a/shared/extra-utils/mock-servers/mock-instances-index.ts b/shared/extra-utils/mock-servers/mock-instances-index.ts index c9e33087d..2aabef9d2 100644 --- a/shared/extra-utils/mock-servers/mock-instances-index.ts +++ b/shared/extra-utils/mock-servers/mock-instances-index.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { randomInt } from '@shared/core-utils' | 2 | import { randomInt } from '@shared/core-utils' |
3 | 3 | ||
4 | export class MockInstancesIndex { | 4 | export class MockInstancesIndex { |
diff --git a/shared/extra-utils/mock-servers/mock-joinpeertube-versions.ts b/shared/extra-utils/mock-servers/mock-joinpeertube-versions.ts index 5ea432ecf..5106fc66a 100644 --- a/shared/extra-utils/mock-servers/mock-joinpeertube-versions.ts +++ b/shared/extra-utils/mock-servers/mock-joinpeertube-versions.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { randomInt } from '@shared/core-utils' | 2 | import { randomInt } from '@shared/core-utils' |
3 | 3 | ||
4 | export class MockJoinPeerTubeVersions { | 4 | export class MockJoinPeerTubeVersions { |
diff --git a/shared/extra-utils/mock-servers/mock-object-storage.ts b/shared/extra-utils/mock-servers/mock-object-storage.ts index 19ea7c87c..f1c5a6123 100644 --- a/shared/extra-utils/mock-servers/mock-object-storage.ts +++ b/shared/extra-utils/mock-servers/mock-object-storage.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import got, { RequestError } from 'got' | 2 | import got, { RequestError } from 'got' |
3 | import { Server } from 'http' | 3 | import { Server } from 'http' |
4 | import { pipeline } from 'stream' | 4 | import { pipeline } from 'stream' |
diff --git a/shared/extra-utils/mock-servers/mock-plugin-blocklist.ts b/shared/extra-utils/mock-servers/mock-plugin-blocklist.ts index d18f8224f..6f66bf4f0 100644 --- a/shared/extra-utils/mock-servers/mock-plugin-blocklist.ts +++ b/shared/extra-utils/mock-servers/mock-plugin-blocklist.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express, { Request, Response } from 'express' |
2 | import { Server } from 'http' | 2 | import { Server } from 'http' |
3 | import { randomInt } from '@shared/core-utils' | 3 | import { randomInt } from '@shared/core-utils' |
4 | 4 | ||
@@ -18,7 +18,7 @@ export class MockBlocklist { | |||
18 | return new Promise<number>(res => { | 18 | return new Promise<number>(res => { |
19 | const app = express() | 19 | const app = express() |
20 | 20 | ||
21 | app.get('/blocklist', (req: express.Request, res: express.Response) => { | 21 | app.get('/blocklist', (req: Request, res: Response) => { |
22 | return res.json(this.body) | 22 | return res.json(this.body) |
23 | }) | 23 | }) |
24 | 24 | ||
diff --git a/shared/extra-utils/mock-servers/mock-proxy.ts b/shared/extra-utils/mock-servers/mock-proxy.ts index 5365f87d1..eb5f177c7 100644 --- a/shared/extra-utils/mock-servers/mock-proxy.ts +++ b/shared/extra-utils/mock-servers/mock-proxy.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | 1 | ||
2 | import { createServer, Server } from 'http' | 2 | import { createServer, Server } from 'http' |
3 | import * as proxy from 'proxy' | 3 | import proxy from 'proxy' |
4 | import { randomInt } from '@shared/core-utils' | 4 | import { randomInt } from '@shared/core-utils' |
5 | 5 | ||
6 | class MockProxy { | 6 | class MockProxy { |
diff --git a/shared/extra-utils/requests/requests.ts b/shared/extra-utils/requests/requests.ts index 5a2b09dcc..60a08b13c 100644 --- a/shared/extra-utils/requests/requests.ts +++ b/shared/extra-utils/requests/requests.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-floating-promises */ | 1 | /* eslint-disable @typescript-eslint/no-floating-promises */ |
2 | 2 | ||
3 | import { decode } from 'querystring' | 3 | import { decode } from 'querystring' |
4 | import * as request from 'supertest' | 4 | import request from 'supertest' |
5 | import { URL } from 'url' | 5 | import { URL } from 'url' |
6 | import { HttpStatusCode } from '@shared/models' | 6 | import { HttpStatusCode } from '@shared/models' |
7 | import { buildAbsoluteFixturePath } from '../miscs/tests' | 7 | import { buildAbsoluteFixturePath } from '../miscs/tests' |
diff --git a/shared/extra-utils/videos/captions.ts b/shared/extra-utils/videos/captions.ts index ff8a43366..fc44cd250 100644 --- a/shared/extra-utils/videos/captions.ts +++ b/shared/extra-utils/videos/captions.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { expect } from 'chai' | 1 | import { expect } from 'chai' |
2 | import * as request from 'supertest' | 2 | import request from 'supertest' |
3 | import { HttpStatusCode } from '@shared/models' | 3 | import { HttpStatusCode } from '@shared/models' |
4 | 4 | ||
5 | async function testCaptionFile (url: string, captionPath: string, containsString: string) { | 5 | async function testCaptionFile (url: string, captionPath: string, containsString: string) { |
diff --git a/shared/extra-utils/videos/live.ts b/shared/extra-utils/videos/live.ts index 29f99ed6d..d3665bc90 100644 --- a/shared/extra-utils/videos/live.ts +++ b/shared/extra-utils/videos/live.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import { expect } from 'chai' | 3 | import { expect } from 'chai' |
4 | import * as ffmpeg from 'fluent-ffmpeg' | 4 | import ffmpeg, { FfmpegCommand } from 'fluent-ffmpeg' |
5 | import { pathExists, readdir } from 'fs-extra' | 5 | import { pathExists, readdir } from 'fs-extra' |
6 | import { join } from 'path' | 6 | import { join } from 'path' |
7 | import { buildAbsoluteFixturePath, wait } from '../miscs' | 7 | import { buildAbsoluteFixturePath, wait } from '../miscs' |
@@ -50,7 +50,7 @@ function sendRTMPStream (options: { | |||
50 | return command | 50 | return command |
51 | } | 51 | } |
52 | 52 | ||
53 | function waitFfmpegUntilError (command: ffmpeg.FfmpegCommand, successAfterMS = 10000) { | 53 | function waitFfmpegUntilError (command: FfmpegCommand, successAfterMS = 10000) { |
54 | return new Promise<void>((res, rej) => { | 54 | return new Promise<void>((res, rej) => { |
55 | command.on('error', err => { | 55 | command.on('error', err => { |
56 | return rej(err) | 56 | return rej(err) |
@@ -62,7 +62,7 @@ function waitFfmpegUntilError (command: ffmpeg.FfmpegCommand, successAfterMS = 1 | |||
62 | }) | 62 | }) |
63 | } | 63 | } |
64 | 64 | ||
65 | async function testFfmpegStreamError (command: ffmpeg.FfmpegCommand, shouldHaveError: boolean) { | 65 | async function testFfmpegStreamError (command: FfmpegCommand, shouldHaveError: boolean) { |
66 | let error: Error | 66 | let error: Error |
67 | 67 | ||
68 | try { | 68 | try { |
@@ -77,7 +77,7 @@ async function testFfmpegStreamError (command: ffmpeg.FfmpegCommand, shouldHaveE | |||
77 | if (!shouldHaveError && error) throw error | 77 | if (!shouldHaveError && error) throw error |
78 | } | 78 | } |
79 | 79 | ||
80 | async function stopFfmpeg (command: ffmpeg.FfmpegCommand) { | 80 | async function stopFfmpeg (command: FfmpegCommand) { |
81 | command.kill('SIGINT') | 81 | command.kill('SIGINT') |
82 | 82 | ||
83 | await wait(500) | 83 | await wait(500) |