@@ -8,13 +8,13 @@ const WORDPRESS_VERSION = process.env.WORDPRESS_VERSION;
88const ADMIN_LOGIN = "admin" ;
99const ADMIN_PASSWORD = "my_very_very_secret_admin_password" ;
1010const LAPI_URL = process . env . LAPI_URL_FROM_CONTAINERS ;
11- const NOTIFY = ! ! process . env . DEBUG ;
11+ const DEBUG = ! ! process . env . DEBUG ;
1212const TIMEOUT = ( ! ! process . env . DEBUG ? 5 * 60 : 8 ) * 1000 ;
1313const OTHER_IP = "1.2.3.4" ;
1414const adminUrl = `${ BASE_URL } /wp-admin/` ;
1515
1616const notify = ( message ) => {
17- if ( NOTIFY ) {
17+ if ( DEBUG ) {
1818 notifier . notify ( {
1919 title : "CrowdSec automation" ,
2020 message : message ,
@@ -33,10 +33,6 @@ const WP56 = WORDPRESS_VERSION === "";
3333const WP55 = WORDPRESS_VERSION === "5.5" ;
3434const WP54 = WORDPRESS_VERSION === "5.4" ;
3535const 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" ;
4036
4137const waitForNavigation = page . waitForNavigation ( ) ;
4238
@@ -266,7 +262,7 @@ const remediationShouldUpdate = async (
266262
267263 describe ( `Setup WordPress ${ WORDPRESS_VERSION } and CrowdSec plugin` , ( ) => {
268264
269- beforeEach ( ( ) => console . log ( expect . getState ( ) . currentTestName ) ) ;
265+ beforeEach ( ( ) => ( DEBUG ? console . log ( expect . getState ( ) . currentTestName ) : null ) )
270266
271267 it ( 'Should install wordpress"' , async ( ) => {
272268 notify ( `Setup WordPress ${ WORDPRESS_VERSION } and CrowdSec plugin` ) ;
@@ -328,7 +324,7 @@ const remediationShouldUpdate = async (
328324
329325describe ( `Run in Live mode` , ( ) => {
330326
331- beforeEach ( ( ) => console . log ( expect . getState ( ) . currentTestName ) ) ;
327+ beforeEach ( ( ) => ( DEBUG ? console . log ( expect . getState ( ) . currentTestName ) : null ) )
332328
333329 it ( 'Should reduce the cache durations"' , async ( ) => {
334330 notify ( "Run in Live mode" ) ;
@@ -493,7 +489,7 @@ describe(`Run in Live mode`, () => {
493489
494490describe ( `Run in Stream mode` , ( ) => {
495491
496- beforeEach ( ( ) => console . log ( expect . getState ( ) . currentTestName ) ) ;
492+ beforeEach ( ( ) => ( DEBUG ? console . log ( expect . getState ( ) . currentTestName ) : null ) )
497493
498494 it ( 'Should enable the stream mode"' , async ( ) => {
499495 notify ( "Run in Stream mode" ) ;
@@ -534,7 +530,7 @@ describe(`Run in Stream mode`, () => {
534530
535531describe ( `Use Redis technology` , ( ) => {
536532
537- beforeEach ( ( ) => console . log ( expect . getState ( ) . currentTestName ) ) ;
533+ beforeEach ( ( ) => ( DEBUG ? console . log ( expect . getState ( ) . currentTestName ) : null ) )
538534
539535 it ( 'Should be able to use Redis cache"' , async ( ) => {
540536 notify ( "Use Redis technology" ) ;
@@ -565,7 +561,7 @@ describe(`Use Redis technology`, () => {
565561
566562describe ( `Use Memcached technology` , ( ) => {
567563
568- beforeEach ( ( ) => console . log ( expect . getState ( ) . currentTestName ) ) ;
564+ beforeEach ( ( ) => ( DEBUG ? console . log ( expect . getState ( ) . currentTestName ) : null ) )
569565
570566 it ( 'Should be able to use Memcached cache"' , async ( ) => {
571567 notify ( "Use Memcached technology" ) ;
0 commit comments