diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-17 15:44:32 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-17 15:47:54 +0200 |
commit | 863477173efa82a4412d2e522aa46462249f9199 (patch) | |
tree | 40f0ae28691780d79acef5ba4dbd2ef0694ce8ff /server/tests/cli | |
parent | e0faa8ad6e18ce6248ef1ec93a59dab5b05be468 (diff) | |
download | PeerTube-863477173efa82a4412d2e522aa46462249f9199.tar.gz PeerTube-863477173efa82a4412d2e522aa46462249f9199.tar.zst PeerTube-863477173efa82a4412d2e522aa46462249f9199.zip |
Cleanup tests imports
Diffstat (limited to 'server/tests/cli')
-rw-r--r-- | server/tests/cli/create-import-video-file-job.ts | 4 | ||||
-rw-r--r-- | server/tests/cli/create-transcoding-job.ts | 4 | ||||
-rw-r--r-- | server/tests/cli/print-transcode-command.ts | 4 | ||||
-rw-r--r-- | server/tests/cli/prune-storage.ts | 4 |
4 files changed, 4 insertions, 12 deletions
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 @@ | |||
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 * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { areObjectStorageTestsDisabled } from '@shared/core-utils' | 4 | import { areObjectStorageTestsDisabled } from '@shared/core-utils' |
5 | import { HttpStatusCode, VideoDetails, VideoFile, VideoInclude } from '@shared/models' | 5 | import { HttpStatusCode, VideoDetails, VideoFile, VideoInclude } from '@shared/models' |
6 | import { | 6 | import { |
@@ -15,8 +15,6 @@ import { | |||
15 | } from '@shared/server-commands' | 15 | } from '@shared/server-commands' |
16 | import { expectStartWith } from '../shared' | 16 | import { expectStartWith } from '../shared' |
17 | 17 | ||
18 | const expect = chai.expect | ||
19 | |||
20 | function assertVideoProperties (video: VideoFile, resolution: number, extname: string, size?: number) { | 18 | function assertVideoProperties (video: VideoFile, resolution: number, extname: string, size?: number) { |
21 | expect(video).to.have.nested.property('resolution.id', resolution) | 19 | expect(video).to.have.nested.property('resolution.id', resolution) |
22 | expect(video).to.have.property('torrentUrl').that.includes(`-${resolution}.torrent`) | 20 | 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 @@ | |||
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 * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { areObjectStorageTestsDisabled } from '@shared/core-utils' | 4 | import { areObjectStorageTestsDisabled } from '@shared/core-utils' |
5 | import { HttpStatusCode, VideoFile } from '@shared/models' | 5 | import { HttpStatusCode, VideoFile } from '@shared/models' |
6 | import { | 6 | import { |
@@ -15,8 +15,6 @@ import { | |||
15 | } from '@shared/server-commands' | 15 | } from '@shared/server-commands' |
16 | import { checkResolutionsInMasterPlaylist, expectStartWith } from '../shared' | 16 | import { checkResolutionsInMasterPlaylist, expectStartWith } from '../shared' |
17 | 17 | ||
18 | const expect = chai.expect | ||
19 | |||
20 | async function checkFilesInObjectStorage (files: VideoFile[], type: 'webtorrent' | 'playlist') { | 18 | async function checkFilesInObjectStorage (files: VideoFile[], type: 'webtorrent' | 'playlist') { |
21 | for (const file of files) { | 19 | for (const file of files) { |
22 | const shouldStartWith = type === 'webtorrent' | 20 | 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 @@ | |||
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 * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { buildAbsoluteFixturePath } from '@shared/core-utils' | 4 | import { buildAbsoluteFixturePath } from '@shared/core-utils' |
5 | import { CLICommand } from '@shared/server-commands' | 5 | import { CLICommand } from '@shared/server-commands' |
6 | import { VideoResolution } from '../../../shared/models/videos' | 6 | import { VideoResolution } from '../../../shared/models/videos' |
7 | 7 | ||
8 | const expect = chai.expect | ||
9 | |||
10 | describe('Test print transcode jobs', function () { | 8 | describe('Test print transcode jobs', function () { |
11 | 9 | ||
12 | it('Should print the correct command for each resolution', async function () { | 10 | 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 @@ | |||
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 * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { createFile, readdir } from 'fs-extra' | 4 | import { createFile, readdir } from 'fs-extra' |
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import { wait } from '@shared/core-utils' | 6 | import { wait } from '@shared/core-utils' |
@@ -19,8 +19,6 @@ import { | |||
19 | waitJobs | 19 | waitJobs |
20 | } from '@shared/server-commands' | 20 | } from '@shared/server-commands' |
21 | 21 | ||
22 | const expect = chai.expect | ||
23 | |||
24 | async function countFiles (server: PeerTubeServer, directory: string) { | 22 | async function countFiles (server: PeerTubeServer, directory: string) { |
25 | const files = await readdir(server.servers.buildDirectory(directory)) | 23 | const files = await readdir(server.servers.buildDirectory(directory)) |
26 | 24 | ||