mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: #10809, test runner to only run tests for plugins included in test_plugins
This commit is contained in:
@@ -1,14 +1,16 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const nconf = require('nconf');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const db = require('./mocks/databasemock');
|
const db = require('./mocks/databasemock');
|
||||||
|
|
||||||
const installedPlugins = fs.readdirSync(path.join(__dirname, '../node_modules'))
|
const active = nconf.get('test_plugins') || [];
|
||||||
.filter(p => p.startsWith('nodebb-'));
|
const toTest = fs.readdirSync(path.join(__dirname, '../node_modules'))
|
||||||
|
.filter(p => p.startsWith('nodebb-') && active.includes(p));
|
||||||
|
|
||||||
describe('Installed Plugins', () => {
|
describe('Installed Plugins', () => {
|
||||||
installedPlugins.forEach((plugin) => {
|
toTest.forEach((plugin) => {
|
||||||
const pathToTests = path.join(__dirname, '../node_modules', plugin, 'test');
|
const pathToTests = path.join(__dirname, '../node_modules', plugin, 'test');
|
||||||
try {
|
try {
|
||||||
require(pathToTests);
|
require(pathToTests);
|
||||||
|
|||||||
Reference in New Issue
Block a user