esModuleInterop to true

This commit is contained in:
Chocobozzz
2021-08-27 14:32:44 +02:00
parent 40e7ed0714
commit 41fb13c330
208 changed files with 444 additions and 425 deletions

View File

@@ -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'

View File

@@ -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'

View File

@@ -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

View File

@@ -1,4 +1,4 @@
import * as express from 'express'
import express from 'express'
import { randomInt } from '@shared/core-utils'
export class MockInstancesIndex {

View File

@@ -1,4 +1,4 @@
import * as express from 'express'
import express from 'express'
import { randomInt } from '@shared/core-utils'
export class MockJoinPeerTubeVersions {

View File

@@ -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'

View File

@@ -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<number>(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)
})

View File

@@ -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 {

View File

@@ -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'

View File

@@ -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) {

View File

@@ -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<void>((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)