mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
test: moved topic event and topic thumb tests to subfolder for better organisation
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const async = require('async');
|
||||
const path = require('path');
|
||||
const assert = require('assert');
|
||||
const validator = require('validator');
|
||||
const mockdate = require('mockdate');
|
||||
@@ -9,6 +10,7 @@ const request = require('request');
|
||||
const util = require('util');
|
||||
|
||||
const db = require('./mocks/databasemock');
|
||||
const file = require('../src/file');
|
||||
const topics = require('../src/topics');
|
||||
const posts = require('../src/posts');
|
||||
const categories = require('../src/categories');
|
||||
@@ -20,7 +22,6 @@ const helpers = require('./helpers');
|
||||
const socketPosts = require('../src/socket.io/posts');
|
||||
const socketTopics = require('../src/socket.io/topics');
|
||||
|
||||
|
||||
const requestType = util.promisify((type, url, opts, cb) => {
|
||||
request[type](url, opts, (err, res, body) => cb(err, { res: res, body: body }));
|
||||
});
|
||||
@@ -2860,3 +2861,18 @@ describe('Topic\'s', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('Topics\'s', async () => {
|
||||
let files;
|
||||
|
||||
before(async () => {
|
||||
files = await file.walk(path.resolve(__dirname, './topics'));
|
||||
console.log(files);
|
||||
});
|
||||
|
||||
it('subfolder tests', () => {
|
||||
files.forEach((filePath) => {
|
||||
require(filePath);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user