mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-28 01:21:13 +01:00
test: add logs for test failures
This commit is contained in:
@@ -155,6 +155,7 @@ Plugins.get = async function (id) {
|
|||||||
const url = `${nconf.get('registry') || 'https://packages.nodebb.org'}/api/v1/plugins/${id}`;
|
const url = `${nconf.get('registry') || 'https://packages.nodebb.org'}/api/v1/plugins/${id}`;
|
||||||
const { response, body } = await request.get(url);
|
const { response, body } = await request.get(url);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
console.log(response);
|
||||||
throw new Error(`[[error:unable-to-load-plugin, ${id}]]`);
|
throw new Error(`[[error:unable-to-load-plugin, ${id}]]`);
|
||||||
}
|
}
|
||||||
let normalised = await Plugins.normalise([body ? body.payload : {}]);
|
let normalised = await Plugins.normalise([body ? body.payload : {}]);
|
||||||
@@ -171,6 +172,7 @@ Plugins.list = async function (matching) {
|
|||||||
try {
|
try {
|
||||||
const { response, body } = await request.get(url);
|
const { response, body } = await request.get(url);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
console.log(response);
|
||||||
throw new Error(`[[error:unable-to-load-plugins-from-nbbpm]]`);
|
throw new Error(`[[error:unable-to-load-plugins-from-nbbpm]]`);
|
||||||
}
|
}
|
||||||
return await Plugins.normalise(body);
|
return await Plugins.normalise(body);
|
||||||
@@ -184,6 +186,7 @@ Plugins.listTrending = async () => {
|
|||||||
const url = `${nconf.get('registry') || 'https://packages.nodebb.org'}/api/v1/analytics/top/week`;
|
const url = `${nconf.get('registry') || 'https://packages.nodebb.org'}/api/v1/analytics/top/week`;
|
||||||
const { response, body } = await request.get(url);
|
const { response, body } = await request.get(url);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
console.log(response);
|
||||||
throw new Error(`[[error:unable-to-load-trending-plugins]]`);
|
throw new Error(`[[error:unable-to-load-trending-plugins]]`);
|
||||||
}
|
}
|
||||||
return body;
|
return body;
|
||||||
|
|||||||
Reference in New Issue
Block a user