diff options
author | Chocobozzz <me@florianbigard.com> | 2022-12-02 17:54:23 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-12-02 17:54:23 +0100 |
commit | b8598d40f650a31fe09a4a5426dcdc2c5c0d566c (patch) | |
tree | ee41176817ef13525aadc4f0b37fc9391364d5c9 /server/tests/shared/video-playlists.ts | |
parent | 190ac9df7c95cdae5294596764afae7ce78d108d (diff) | |
parent | bd09dfaf8dcb0ca4cd5dac9f13e3117486f3bcce (diff) | |
download | PeerTube-b8598d40f650a31fe09a4a5426dcdc2c5c0d566c.tar.gz PeerTube-b8598d40f650a31fe09a4a5426dcdc2c5c0d566c.tar.zst PeerTube-b8598d40f650a31fe09a4a5426dcdc2c5c0d566c.zip |
Merge branch 'release/5.0.0' into develop
Diffstat (limited to 'server/tests/shared/video-playlists.ts')
-rw-r--r-- | server/tests/shared/video-playlists.ts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/server/tests/shared/video-playlists.ts b/server/tests/shared/video-playlists.ts new file mode 100644 index 000000000..8db303fd8 --- /dev/null +++ b/server/tests/shared/video-playlists.ts | |||
@@ -0,0 +1,22 @@ | |||
1 | import { expect } from 'chai' | ||
2 | import { readdir } from 'fs-extra' | ||
3 | import { PeerTubeServer } from '@shared/server-commands' | ||
4 | |||
5 | async function checkPlaylistFilesWereRemoved ( | ||
6 | playlistUUID: string, | ||
7 | server: PeerTubeServer, | ||
8 | directories = [ 'thumbnails' ] | ||
9 | ) { | ||
10 | for (const directory of directories) { | ||
11 | const directoryPath = server.getDirectoryPath(directory) | ||
12 | |||
13 | const files = await readdir(directoryPath) | ||
14 | for (const file of files) { | ||
15 | expect(file).to.not.contain(playlistUUID) | ||
16 | } | ||
17 | } | ||
18 | } | ||
19 | |||
20 | export { | ||
21 | checkPlaylistFilesWereRemoved | ||
22 | } | ||