ActivityPub-federated video streaming platform using P2P directly in your web browser
Improve plugin constant tests
Chocobozzz2b9f672b58bc
diff --git a/scripts/ci.sh b/scripts/ci.shindex 07e37e0eee..7862888b8e 100755--- a/scripts/ci.sh+++ b/scripts/ci.sh@@ -47,11 +47,12 @@ if [ "$1" = "client" ]; thenfeedsFiles=$(findTestFiles ./dist/server/tests/feeds)helperFiles=$(findTestFiles ./dist/server/tests/helpers)+ libFiles=$(findTestFiles ./dist/server/tests/lib)miscFiles="./dist/server/tests/client.js ./dist/server/tests/misc-endpoints.js"# Not in plugin task, it needs an index.htmlpluginFiles="./dist/server/tests/plugins/html-injection.js"- MOCHA_PARALLEL=true runTest "$1" 2 $feedsFiles $helperFiles $miscFiles $pluginFiles+ MOCHA_PARALLEL=true runTest "$1" 2 $feedsFiles $helperFiles $miscFiles $pluginFiles $libFileselif [ "$1" = "cli-plugin" ]; thennpm run build:servernpm run setup:clidiff --git a/server/tests/fixtures/peertube-plugin-test-video-constants/main.js b/server/tests/fixtures/peertube-plugin-test-video-constants/main.jsindex f44704a448..06527bd358 100644--- a/server/tests/fixtures/peertube-plugin-test-video-constants/main.js+++ b/server/tests/fixtures/peertube-plugin-test-video-constants/main.js@@ -7,24 +7,26 @@ async function register ({getRouter}) {videoLanguageManager.addConstant('al_bhed', 'Al Bhed')- videoLanguageManager.addConstant('al_bhed2', 'Al Bhed 2')+ videoLanguageManager.addLanguage('al_bhed2', 'Al Bhed 2')videoLanguageManager.addConstant('al_bhed3', 'Al Bhed 3')videoLanguageManager.deleteConstant('en')- videoLanguageManager.deleteConstant('fr')+ videoLanguageManager.deleteLanguage('fr')videoLanguageManager.deleteConstant('al_bhed3')- videoCategoryManager.addConstant(42, 'Best category')+ videoCategoryManager.addCategory(42, 'Best category')videoCategoryManager.addConstant(43, 'High best category')videoCategoryManager.deleteConstant(1) // Music- videoCategoryManager.deleteConstant(2) // Films+ videoCategoryManager.deleteCategory(2) // Films- videoLicenceManager.addConstant(42, 'Best licence')+ videoLicenceManager.addLicence(42, 'Best licence')videoLicenceManager.addConstant(43, 'High best licence')videoLicenceManager.deleteConstant(1) // AttributionvideoLicenceManager.deleteConstant(7) // Public domainvideoPrivacyManager.deleteConstant(2)+ videoPrivacyManager.deletePrivacy(2)playlistPrivacyManager.deleteConstant(3)+ playlistPrivacyManager.deletePlaylistPrivacy(3){const router = getRouter()diff --git a/server/tests/index.ts b/server/tests/index.tsindex 3fbd0ebbde..1718ac4240 100644--- a/server/tests/index.ts+++ b/server/tests/index.ts@@ -6,3 +6,4 @@ import './cli/'import './api/'import './plugins/'import './helpers/'+import './lib/'diff --git a/server/tests/lib/index.ts b/server/tests/lib/index.tsnew file mode 100644index 0000000000..a40df35fd7--- /dev/null+++ b/server/tests/lib/index.ts@@ -0,0 +1 @@+export * from './video-constant-registry-factory'diff --git a/server/tests/lib/plugins/video-constant-registry-factory.test.ts b/server/tests/lib/video-constant-registry-factory.tssimilarity index 100%rename from server/tests/lib/plugins/video-constant-registry-factory.test.tsrename to server/tests/lib/video-constant-registry-factory.ts