From 863477173efa82a4412d2e522aa46462249f9199 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 17 Aug 2022 15:44:32 +0200 Subject: Cleanup tests imports --- server/tests/cli/create-import-video-file-job.ts | 4 +--- server/tests/cli/create-transcoding-job.ts | 4 +--- server/tests/cli/print-transcode-command.ts | 4 +--- server/tests/cli/prune-storage.ts | 4 +--- 4 files changed, 4 insertions(+), 12 deletions(-) (limited to 'server/tests/cli') diff --git a/server/tests/cli/create-import-video-file-job.ts b/server/tests/cli/create-import-video-file-job.ts index aa24e6996..2cf2dd8f8 100644 --- a/server/tests/cli/create-import-video-file-job.ts +++ b/server/tests/cli/create-import-video-file-job.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import * as chai from 'chai' +import { expect } from 'chai' import { areObjectStorageTestsDisabled } from '@shared/core-utils' import { HttpStatusCode, VideoDetails, VideoFile, VideoInclude } from '@shared/models' import { @@ -15,8 +15,6 @@ import { } from '@shared/server-commands' import { expectStartWith } from '../shared' -const expect = chai.expect - function assertVideoProperties (video: VideoFile, resolution: number, extname: string, size?: number) { expect(video).to.have.nested.property('resolution.id', resolution) expect(video).to.have.property('torrentUrl').that.includes(`-${resolution}.torrent`) diff --git a/server/tests/cli/create-transcoding-job.ts b/server/tests/cli/create-transcoding-job.ts index 48302c9e4..8897d8c23 100644 --- a/server/tests/cli/create-transcoding-job.ts +++ b/server/tests/cli/create-transcoding-job.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import * as chai from 'chai' +import { expect } from 'chai' import { areObjectStorageTestsDisabled } from '@shared/core-utils' import { HttpStatusCode, VideoFile } from '@shared/models' import { @@ -15,8 +15,6 @@ import { } from '@shared/server-commands' import { checkResolutionsInMasterPlaylist, expectStartWith } from '../shared' -const expect = chai.expect - async function checkFilesInObjectStorage (files: VideoFile[], type: 'webtorrent' | 'playlist') { for (const file of files) { const shouldStartWith = type === 'webtorrent' diff --git a/server/tests/cli/print-transcode-command.ts b/server/tests/cli/print-transcode-command.ts index ab4df46fc..33b6cd27c 100644 --- a/server/tests/cli/print-transcode-command.ts +++ b/server/tests/cli/print-transcode-command.ts @@ -1,12 +1,10 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import * as chai from 'chai' +import { expect } from 'chai' import { buildAbsoluteFixturePath } from '@shared/core-utils' import { CLICommand } from '@shared/server-commands' import { VideoResolution } from '../../../shared/models/videos' -const expect = chai.expect - describe('Test print transcode jobs', function () { it('Should print the correct command for each resolution', async function () { diff --git a/server/tests/cli/prune-storage.ts b/server/tests/cli/prune-storage.ts index 15bfb30f0..a89e17e3c 100644 --- a/server/tests/cli/prune-storage.ts +++ b/server/tests/cli/prune-storage.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import * as chai from 'chai' +import { expect } from 'chai' import { createFile, readdir } from 'fs-extra' import { join } from 'path' import { wait } from '@shared/core-utils' @@ -19,8 +19,6 @@ import { waitJobs } from '@shared/server-commands' -const expect = chai.expect - async function countFiles (server: PeerTubeServer, directory: string) { const files = await readdir(server.servers.buildDirectory(directory)) -- cgit v1.2.3