File tree 3 files changed +9
-0
lines changed
3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 6
6
"ipBlacklist" : []
7
7
},
8
8
"general" : {
9
+ "environment" : " production" ,
9
10
"alertMinimumTime" : 120 ,
10
11
"imgUrl" : " https://raw.githubusercontent.com/nileplumb/PkmnShuffleMap/master/PMSF_icons_large/" ,
11
12
"locale" : " en"
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ const fs = require('fs')
2
2
const Mocha = require ( 'mocha' )
3
3
const { promisify } = require ( 'util' )
4
4
const { resolve } = require ( 'path' )
5
+ const config = require ( 'config' )
6
+ const { log } = require ( './../src/lib/logger' )
5
7
6
8
const mocha = new Mocha ( )
7
9
const readdir = promisify ( fs . readdir )
@@ -18,6 +20,11 @@ async function getFiles(dir) {
18
20
}
19
21
20
22
async function run ( ) {
23
+ if ( config . general . environment . toLowerCase ( ) === 'production' ) {
24
+ log . info ( 'Tests should not be run in Production mode, it affects your configured database' )
25
+ log . info ( 'If you know what you are doing, set config.general.environment to "Test" first' )
26
+ process . exit ( )
27
+ }
21
28
const tests = await getFiles ( `${ __dirname } /tests` )
22
29
tests . filter ( ( file ) => file . substr ( - 3 ) === '.js' ) . forEach ( ( filePath ) => mocha . addFile ( filePath ) )
23
30
mocha . run ( ( failures ) => {
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ describe('!poracle command tests', () => {
34
34
assert . equal ( result . id , '222' )
35
35
assert . equal ( result . type , 'discord:user' )
36
36
assert . equal ( result . name , 'happyAuthorsUsername' )
37
+ assert . equal ( result . area , '[]' )
37
38
assert . equal ( client . lastReact , '✅' )
38
39
assert . exists ( client . lastMessage . embed )
39
40
assert . equal ( client . lastMessage . embed . title , 'Welcome' )
You can’t perform that action at this time.
0 commit comments