From 41fb13c330de629df2d23379209e79c7af0f2e9a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 27 Aug 2021 14:32:44 +0200 Subject: esModuleInterop to true --- shared/extra-utils/miscs/generate.ts | 2 +- shared/extra-utils/miscs/webtorrent.ts | 2 +- shared/extra-utils/mock-servers/mock-email.ts | 3 +-- shared/extra-utils/mock-servers/mock-instances-index.ts | 2 +- shared/extra-utils/mock-servers/mock-joinpeertube-versions.ts | 2 +- shared/extra-utils/mock-servers/mock-object-storage.ts | 2 +- shared/extra-utils/mock-servers/mock-plugin-blocklist.ts | 4 ++-- shared/extra-utils/mock-servers/mock-proxy.ts | 2 +- shared/extra-utils/requests/requests.ts | 2 +- shared/extra-utils/videos/captions.ts | 2 +- shared/extra-utils/videos/live.ts | 8 ++++---- 11 files changed, 15 insertions(+), 16 deletions(-) (limited to 'shared') 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 @@ import { expect } from 'chai' -import * as ffmpeg from 'fluent-ffmpeg' +import ffmpeg from 'fluent-ffmpeg' import { ensureDir, pathExists } from 'fs-extra' import { dirname } from 'path' 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 @@ import { readFile } from 'fs-extra' -import * as parseTorrent from 'parse-torrent' +import parseTorrent from 'parse-torrent' import { basename, join } from 'path' import * as WebTorrent from 'webtorrent' 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 @@ import { ChildProcess } from 'child_process' +import MailDev from 'maildev' import { randomInt } from '@shared/core-utils' import { parallelTests } from '../miscs' -const MailDev = require('maildev') - class MockSmtpServer { 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 @@ -import * as express from 'express' +import express from 'express' import { randomInt } from '@shared/core-utils' 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 @@ -import * as express from 'express' +import express from 'express' import { randomInt } from '@shared/core-utils' 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 @@ -import * as express from 'express' +import express from 'express' import got, { RequestError } from 'got' import { Server } from 'http' 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 @@ -import * as express from 'express' +import express, { Request, Response } from 'express' import { Server } from 'http' import { randomInt } from '@shared/core-utils' @@ -18,7 +18,7 @@ export class MockBlocklist { return new Promise(res => { const app = express() - app.get('/blocklist', (req: express.Request, res: express.Response) => { + app.get('/blocklist', (req: Request, res: Response) => { return res.json(this.body) }) 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 @@ import { createServer, Server } from 'http' -import * as proxy from 'proxy' +import proxy from 'proxy' import { randomInt } from '@shared/core-utils' 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 @@ /* eslint-disable @typescript-eslint/no-floating-promises */ import { decode } from 'querystring' -import * as request from 'supertest' +import request from 'supertest' import { URL } from 'url' import { HttpStatusCode } from '@shared/models' 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 @@ import { expect } from 'chai' -import * as request from 'supertest' +import request from 'supertest' import { HttpStatusCode } from '@shared/models' 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 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' -import * as ffmpeg from 'fluent-ffmpeg' +import ffmpeg, { FfmpegCommand } from 'fluent-ffmpeg' import { pathExists, readdir } from 'fs-extra' import { join } from 'path' import { buildAbsoluteFixturePath, wait } from '../miscs' @@ -50,7 +50,7 @@ function sendRTMPStream (options: { return command } -function waitFfmpegUntilError (command: ffmpeg.FfmpegCommand, successAfterMS = 10000) { +function waitFfmpegUntilError (command: FfmpegCommand, successAfterMS = 10000) { return new Promise((res, rej) => { command.on('error', err => { return rej(err) @@ -62,7 +62,7 @@ function waitFfmpegUntilError (command: ffmpeg.FfmpegCommand, successAfterMS = 1 }) } -async function testFfmpegStreamError (command: ffmpeg.FfmpegCommand, shouldHaveError: boolean) { +async function testFfmpegStreamError (command: FfmpegCommand, shouldHaveError: boolean) { let error: Error try { @@ -77,7 +77,7 @@ async function testFfmpegStreamError (command: ffmpeg.FfmpegCommand, shouldHaveE if (!shouldHaveError && error) throw error } -async function stopFfmpeg (command: ffmpeg.FfmpegCommand) { +async function stopFfmpeg (command: FfmpegCommand) { command.kill('SIGINT') await wait(500) -- cgit v1.2.3