test: moved topic event and topic thumb tests to subfolder for better organisation

This commit is contained in:
Julian Lam
2021-10-13 21:01:59 -04:00
parent 4ff5452d6f
commit 154ffea01b
3 changed files with 57 additions and 42 deletions

View File

@@ -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);
});
});
});