mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 01:56:12 +01:00
* axios migration * controller tests * add missing deps * feeds * remove unused async * flags * locale-detect * messaging/middleware * remove log * meta * plugins * posts * search * topics/thumbs * user/emails * uploads.js * socket.io * cleaunup * test native fetch * cleanup * increase engine to 18 fix remaining tests * remove testing file * fix comments,typo * revert debug
This commit is contained in:
committed by
GitHub
parent
451430006e
commit
c15bdd4cf0
@@ -3,11 +3,12 @@
|
||||
const assert = require('assert');
|
||||
const path = require('path');
|
||||
const nconf = require('nconf');
|
||||
const request = require('request');
|
||||
|
||||
const fs = require('fs');
|
||||
|
||||
const db = require('./mocks/databasemock');
|
||||
const plugins = require('../src/plugins');
|
||||
const request = require('../src/request');
|
||||
|
||||
describe('Plugins', () => {
|
||||
it('should load plugin data', (done) => {
|
||||
@@ -290,33 +291,24 @@ describe('Plugins', () => {
|
||||
});
|
||||
|
||||
describe('static assets', () => {
|
||||
it('should 404 if resource does not exist', (done) => {
|
||||
request.get(`${nconf.get('url')}/plugins/doesnotexist/should404.tpl`, (err, res, body) => {
|
||||
assert.ifError(err);
|
||||
assert.equal(res.statusCode, 404);
|
||||
assert(body);
|
||||
done();
|
||||
});
|
||||
it('should 404 if resource does not exist', async () => {
|
||||
const { response, body } = await request.get(`${nconf.get('url')}/plugins/doesnotexist/should404.tpl`);
|
||||
assert.equal(response.statusCode, 404);
|
||||
assert(body);
|
||||
});
|
||||
|
||||
it('should 404 if resource does not exist', (done) => {
|
||||
it('should 404 if resource does not exist', async () => {
|
||||
const url = `${nconf.get('url')}/plugins/nodebb-plugin-dbsearch/dbsearch/templates/admin/plugins/should404.tpl`;
|
||||
request.get(url, (err, res, body) => {
|
||||
assert.ifError(err);
|
||||
assert.equal(res.statusCode, 404);
|
||||
assert(body);
|
||||
done();
|
||||
});
|
||||
const { response, body } = await request.get(url);
|
||||
assert.equal(response.statusCode, 404);
|
||||
assert(body);
|
||||
});
|
||||
|
||||
it('should get resource', (done) => {
|
||||
it('should get resource', async () => {
|
||||
const url = `${nconf.get('url')}/assets/templates/admin/plugins/dbsearch.tpl`;
|
||||
request.get(url, (err, res, body) => {
|
||||
assert.ifError(err);
|
||||
assert.equal(res.statusCode, 200);
|
||||
assert(body);
|
||||
done();
|
||||
});
|
||||
const { response, body } = await request.get(url);
|
||||
assert.equal(response.statusCode, 200);
|
||||
assert(body);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -371,7 +363,6 @@ describe('Plugins', () => {
|
||||
assert.ifError(err);
|
||||
assert(Array.isArray(data));
|
||||
data.forEach((pluginData) => {
|
||||
console.log(pluginData);
|
||||
assert(activePlugins.includes(pluginData));
|
||||
});
|
||||
done();
|
||||
|
||||
Reference in New Issue
Block a user