1 import { expect } from 'chai'
2 import { FIXTURE_URLS } from '@server/tests/shared'
3 import { areHttpImportTestsDisabled } from '@shared/core-utils'
8 setAccessTokensToServers,
9 setDefaultVideoChannel,
11 } from '@shared/server-commands'
13 describe('Test videos import in a channel', function () {
14 if (areHttpImportTestsDisabled()) return
16 function runSuite (mode: 'youtube-dl' | 'yt-dlp') {
18 describe('Import using ' + mode, function () {
19 let server: PeerTubeServer
21 before(async function () {
24 server = await createSingleServer(1, getServerImportConfig(mode))
26 await setAccessTokensToServers([ server ])
27 await setDefaultVideoChannel([ server ])
29 await server.config.enableChannelSync()
32 it('Should import a whole channel', async function () {
35 await server.channels.importVideos({ channelName: server.store.channel.name, externalChannelUrl: FIXTURE_URLS.youtubeChannel })
36 await waitJobs(server)
38 const videos = await server.videos.listByChannel({ handle: server.store.channel.name })
39 expect(videos.total).to.equal(2)
42 after(async function () {
49 runSuite('youtube-dl')