mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
esModuleInterop to true
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as express from 'express'
|
||||
import express from 'express'
|
||||
import { randomInt } from '@shared/core-utils'
|
||||
|
||||
export class MockInstancesIndex {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as express from 'express'
|
||||
import express from 'express'
|
||||
import { randomInt } from '@shared/core-utils'
|
||||
|
||||
export class MockJoinPeerTubeVersions {
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user