-
Notifications
You must be signed in to change notification settings - Fork 58
/
test.js
50 lines (42 loc) · 1.15 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// NOTE: ./struct not included on test
const options = {
paths: [
'action', 'anime', 'bot',
'core', 'fun', 'moderation',
'owner', 'setup', 'social','utility'
]
};
const { readdir } = require('fs');
// Test events
for (const path of options.paths){
readdir(`./commands/${path}`, (err, files) => {
files.filter(file => file.split('.').pop === 'js').forEach(file => {
require(`./commands/${path}/${file}`);
});
});
};
// Test events
readdir(`./events`, (err, files) => {
files.filter(file => file.split('.').pop() === 'js').forEach(file => {
require(`./events/${file}`);
});
});
// Test JSON assets
readdir('./assets/json', (err, files) => {
files.filter(file => file.split('.').pop() === 'json').forEach(file => {
require(`./assets/json/${file}`);
});
});
// Test utils
readdir('./util', (err, files) => {
files.filter(file => file.split('.').pop() === 'js').forEach(file => {
require(`./util/${file}`);
});
});
// Test ./utils/games
readdir('./util/games', (err, files) => {
files.filter(file => file.split('.').pop() === 'js').forEach(file => {
require(`./util/games/${file}`);
});
});
// End of Test