@@ -8,13 +8,13 @@ const WORDPRESS_VERSION = process.env.WORDPRESS_VERSION;
8
8
const ADMIN_LOGIN = "admin" ;
9
9
const ADMIN_PASSWORD = "my_very_very_secret_admin_password" ;
10
10
const LAPI_URL = process . env . LAPI_URL_FROM_CONTAINERS ;
11
- const NOTIFY = ! ! process . env . DEBUG ;
11
+ const DEBUG = ! ! process . env . DEBUG ;
12
12
const TIMEOUT = ( ! ! process . env . DEBUG ? 5 * 60 : 8 ) * 1000 ;
13
13
const OTHER_IP = "1.2.3.4" ;
14
14
const adminUrl = `${ BASE_URL } /wp-admin/` ;
15
15
16
16
const notify = ( message ) => {
17
- if ( NOTIFY ) {
17
+ if ( DEBUG ) {
18
18
notifier . notify ( {
19
19
title : "CrowdSec automation" ,
20
20
message : message ,
@@ -33,10 +33,6 @@ const WP56 = WORDPRESS_VERSION === "";
33
33
const WP55 = WORDPRESS_VERSION === "5.5" ;
34
34
const WP54 = WORDPRESS_VERSION === "5.4" ;
35
35
const WP53 = WORDPRESS_VERSION === "5.3" ;
36
- const WP52 = WORDPRESS_VERSION === "5.2" ;
37
- const WP51 = WORDPRESS_VERSION === "5.1" ;
38
- const WP50 = WORDPRESS_VERSION === "5.0" ;
39
- const WP49 = WORDPRESS_VERSION === "4.9" ;
40
36
41
37
const waitForNavigation = page . waitForNavigation ( ) ;
42
38
@@ -266,7 +262,7 @@ const remediationShouldUpdate = async (
266
262
267
263
describe ( `Setup WordPress ${ WORDPRESS_VERSION } and CrowdSec plugin` , ( ) => {
268
264
269
- beforeEach ( ( ) => console . log ( expect . getState ( ) . currentTestName ) ) ;
265
+ beforeEach ( ( ) => ( DEBUG ? console . log ( expect . getState ( ) . currentTestName ) : null ) )
270
266
271
267
it ( 'Should install wordpress"' , async ( ) => {
272
268
notify ( `Setup WordPress ${ WORDPRESS_VERSION } and CrowdSec plugin` ) ;
@@ -328,7 +324,7 @@ const remediationShouldUpdate = async (
328
324
329
325
describe ( `Run in Live mode` , ( ) => {
330
326
331
- beforeEach ( ( ) => console . log ( expect . getState ( ) . currentTestName ) ) ;
327
+ beforeEach ( ( ) => ( DEBUG ? console . log ( expect . getState ( ) . currentTestName ) : null ) )
332
328
333
329
it ( 'Should reduce the cache durations"' , async ( ) => {
334
330
notify ( "Run in Live mode" ) ;
@@ -493,7 +489,7 @@ describe(`Run in Live mode`, () => {
493
489
494
490
describe ( `Run in Stream mode` , ( ) => {
495
491
496
- beforeEach ( ( ) => console . log ( expect . getState ( ) . currentTestName ) ) ;
492
+ beforeEach ( ( ) => ( DEBUG ? console . log ( expect . getState ( ) . currentTestName ) : null ) )
497
493
498
494
it ( 'Should enable the stream mode"' , async ( ) => {
499
495
notify ( "Run in Stream mode" ) ;
@@ -534,7 +530,7 @@ describe(`Run in Stream mode`, () => {
534
530
535
531
describe ( `Use Redis technology` , ( ) => {
536
532
537
- beforeEach ( ( ) => console . log ( expect . getState ( ) . currentTestName ) ) ;
533
+ beforeEach ( ( ) => ( DEBUG ? console . log ( expect . getState ( ) . currentTestName ) : null ) )
538
534
539
535
it ( 'Should be able to use Redis cache"' , async ( ) => {
540
536
notify ( "Use Redis technology" ) ;
@@ -565,7 +561,7 @@ describe(`Use Redis technology`, () => {
565
561
566
562
describe ( `Use Memcached technology` , ( ) => {
567
563
568
- beforeEach ( ( ) => console . log ( expect . getState ( ) . currentTestName ) ) ;
564
+ beforeEach ( ( ) => ( DEBUG ? console . log ( expect . getState ( ) . currentTestName ) : null ) )
569
565
570
566
it ( 'Should be able to use Memcached cache"' , async ( ) => {
571
567
notify ( "Use Memcached technology" ) ;
0 commit comments