+function getPluginsCSS (url: string) {
+ const path = '/plugins/global.css'
+
+ return makeGetRequest({
+ url,
+ path,
+ statusCodeExpected: 200
+ })
+}
+
+function getPackageJSONPath (server: ServerInfo, npmName: string) {
+ return join(root(), 'test' + server.internalServerNumber, 'plugins', 'node_modules', npmName, 'package.json')
+}
+
+function updatePluginPackageJSON (server: ServerInfo, npmName: string, json: any) {
+ const path = getPackageJSONPath(server, npmName)
+
+ return writeJSON(path, json)
+}
+
+function getPluginPackageJSON (server: ServerInfo, npmName: string) {
+ const path = getPackageJSONPath(server, npmName)
+
+ return readJSON(path)
+}
+
+function getPluginTestPath (suffix = '') {
+ return join(root(), 'server', 'tests', 'fixtures', 'peertube-plugin-test' + suffix)
+}
+
+function getExternalAuth (options: {
+ url: string
+ npmName: string
+ npmVersion: string
+ authName: string
+ query?: any
+ statusCodeExpected?: number
+}) {
+ const { url, npmName, npmVersion, authName, statusCodeExpected, query } = options
+
+ const path = '/plugins/' + npmName + '/' + npmVersion + '/auth/' + authName
+
+ return makeGetRequest({
+ url,
+ path,
+ query,
+ statusCodeExpected: statusCodeExpected || 200,
+ redirects: 0
+ })
+}
+