From 41137192096590b171563bc3161ede6f5c1d15db Mon Sep 17 00:00:00 2001 From: John Livingston Date: Thu, 8 Apr 2021 17:19:12 +0200 Subject: Tests that show the bug. --- .../fixtures/peertube-plugin-test-unloading/lib.js | 2 ++ .../fixtures/peertube-plugin-test-unloading/main.js | 14 ++++++++++++++ .../peertube-plugin-test-unloading/package.json | 20 ++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 server/tests/fixtures/peertube-plugin-test-unloading/lib.js create mode 100644 server/tests/fixtures/peertube-plugin-test-unloading/main.js create mode 100644 server/tests/fixtures/peertube-plugin-test-unloading/package.json (limited to 'server/tests/fixtures/peertube-plugin-test-unloading') diff --git a/server/tests/fixtures/peertube-plugin-test-unloading/lib.js b/server/tests/fixtures/peertube-plugin-test-unloading/lib.js new file mode 100644 index 000000000..f57e7cb01 --- /dev/null +++ b/server/tests/fixtures/peertube-plugin-test-unloading/lib.js @@ -0,0 +1,2 @@ +const d = new Date() +exports.value = d.getTime() diff --git a/server/tests/fixtures/peertube-plugin-test-unloading/main.js b/server/tests/fixtures/peertube-plugin-test-unloading/main.js new file mode 100644 index 000000000..5c8457cef --- /dev/null +++ b/server/tests/fixtures/peertube-plugin-test-unloading/main.js @@ -0,0 +1,14 @@ +const lib = require('./lib') + +async function register ({ getRouter }) { + const router = getRouter() + router.get('/get', (req, res) => res.json({ message: lib.value })) +} + +async function unregister () { +} + +module.exports = { + register, + unregister +} diff --git a/server/tests/fixtures/peertube-plugin-test-unloading/package.json b/server/tests/fixtures/peertube-plugin-test-unloading/package.json new file mode 100644 index 000000000..7076d4b6f --- /dev/null +++ b/server/tests/fixtures/peertube-plugin-test-unloading/package.json @@ -0,0 +1,20 @@ +{ + "name": "peertube-plugin-test-unloading", + "version": "0.0.1", + "description": "Plugin test (modules unloading)", + "engine": { + "peertube": ">=1.3.0" + }, + "keywords": [ + "peertube", + "plugin" + ], + "homepage": "https://github.com/Chocobozzz/PeerTube", + "author": "Chocobozzz", + "bugs": "https://github.com/Chocobozzz/PeerTube/issues", + "library": "./main.js", + "staticDirs": {}, + "css": [], + "clientScripts": [], + "translations": {} +} -- cgit v1.2.3