mirror of https://github.com/Chocobozzz/PeerTube
Fix tests
parent
fab70099b1
commit
3a2e457320
|
@ -84,6 +84,20 @@ describe('Test proxy', function () {
|
|||
|
||||
describe('Videos import', async function () {
|
||||
|
||||
function getProxyConfig (url: string) {
|
||||
return {
|
||||
import: {
|
||||
videos: {
|
||||
http: {
|
||||
proxies: url
|
||||
? [ url ]
|
||||
: []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function quickImport (expectedStatus: HttpStatusCodeType = HttpStatusCode.OK_200) {
|
||||
return servers[0].videoImports.importVideo({
|
||||
attributes: {
|
||||
|
@ -100,7 +114,7 @@ describe('Test proxy', function () {
|
|||
this.timeout(240000)
|
||||
|
||||
await servers[0].kill()
|
||||
await servers[0].run({}, { env: goodEnv })
|
||||
await servers[0].run(getProxyConfig(null), { env: goodEnv })
|
||||
|
||||
await quickImport()
|
||||
|
||||
|
@ -111,11 +125,20 @@ describe('Test proxy', function () {
|
|||
expect(data).to.have.lengthOf(3)
|
||||
})
|
||||
|
||||
it('Should fail import with a wrong proxy config', async function () {
|
||||
it('Should fail import with a wrong proxy config in env', async function () {
|
||||
this.timeout(120000)
|
||||
|
||||
await servers[0].kill()
|
||||
await servers[0].run({}, { env: badEnv })
|
||||
await servers[0].run(getProxyConfig(null), { env: badEnv })
|
||||
|
||||
await quickImport(HttpStatusCode.BAD_REQUEST_400)
|
||||
})
|
||||
|
||||
it('Should fail import with a wrong proxy config in config', async function () {
|
||||
this.timeout(120000)
|
||||
|
||||
await servers[0].kill()
|
||||
await servers[0].run(getProxyConfig('http://localhost:9000'))
|
||||
|
||||
await quickImport(HttpStatusCode.BAD_REQUEST_400)
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue