mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-11-03 20:45:58 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			616 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			616 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
'use strict';
 | 
						|
 | 
						|
const nconf = require('nconf');
 | 
						|
const path = require('path');
 | 
						|
const fs = require('fs');
 | 
						|
const db = require('./mocks/databasemock');
 | 
						|
 | 
						|
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', () => {
 | 
						|
	toTest.forEach((plugin) => {
 | 
						|
		const pathToTests = path.join(__dirname, '../node_modules', plugin, 'test');
 | 
						|
		try {
 | 
						|
			require(pathToTests);
 | 
						|
		} catch (err) {
 | 
						|
			if (err.code !== 'MODULE_NOT_FOUND') {
 | 
						|
				console.log(err.stack);
 | 
						|
			}
 | 
						|
		}
 | 
						|
	});
 | 
						|
});
 |