|
|
|
@ -1,14 +1,16 @@
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
const nconf = require('nconf');
|
|
|
|
|
const path = require('path');
|
|
|
|
|
const fs = require('fs');
|
|
|
|
|
const db = require('./mocks/databasemock');
|
|
|
|
|
|
|
|
|
|
const installedPlugins = fs.readdirSync(path.join(__dirname, '../node_modules'))
|
|
|
|
|
.filter(p => p.startsWith('nodebb-'));
|
|
|
|
|
const active = nconf.get('test_plugins') || [];
|
|
|
|
|
const toTest = fs.readdirSync(path.join(__dirname, '../node_modules'))
|
|
|
|
|
.filter(p => p.startsWith('nodebb-') && active.includes(p));
|
|
|
|
|
|
|
|
|
|
describe('Installed Plugins', () => {
|
|
|
|
|
installedPlugins.forEach((plugin) => {
|
|
|
|
|
toTest.forEach((plugin) => {
|
|
|
|
|
const pathToTests = path.join(__dirname, '../node_modules', plugin, 'test');
|
|
|
|
|
try {
|
|
|
|
|
require(pathToTests);
|
|
|
|
|