Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix tests

Chocobozzz3a2e45732064
diff --git a/packages/tests/src/api/server/proxy.ts b/packages/tests/src/api/server/proxy.ts
index 6c9d5db69a..0711759438 100644
--- a/packages/tests/src/api/server/proxy.ts
+++ b/packages/tests/src/api/server/proxy.ts
@@ -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)
})