File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed 
libs/backend-api7/e2e/support Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import axios from 'axios';
22import  {  spawn  }  from  'node:child_process' ; 
33import  {  randomUUID  }  from  'node:crypto' ; 
44import  {  Agent  }  from  'node:https' ; 
5- import  {   gte ,   lt   }  from  'semver' ; 
5+ import  *   as   semver  from  'semver' ; 
66
77const  httpClient  =  axios . create ( { 
88  baseURL : 'https://localhost:7443' , 
@@ -68,7 +68,12 @@ const initUser = async (username = 'admin', password = 'admin') => {
6868  } ) ; 
6969
7070  // If the version is lower than 3.2.15, the license should be activated first. 
71-   if  ( lt ( '3.2.15' ,  process . env . BACKEND_API7_VERSION  ??  '0.0.0' ) ) 
71+   if  ( 
72+     semver . lt ( 
73+       '3.2.15' , 
74+       semver . coerce ( process . env . BACKEND_API7_VERSION )  ??  '0.0.0' , 
75+     ) 
76+   ) 
7277    await  activateAPI7 ( ) ; 
7378
7479  console . log ( 'Modify password' ) ; 
@@ -88,7 +93,12 @@ const initUser = async (username = 'admin', password = 'admin') => {
8893
8994  // If the version is greater than or equal to 3.2.15, the license should 
9095  // be activated after changing the password. 
91-   if  ( gte ( '3.2.15' ,  process . env . BACKEND_API7_VERSION  ??  '0.0.0' ) ) 
96+   if  ( 
97+     semver . gte ( 
98+       '3.2.15' , 
99+       semver . coerce ( process . env . BACKEND_API7_VERSION )  ??  '0.0.0' , 
100+     ) 
101+   ) 
92102    await  activateAPI7 ( ) ; 
93103} ; 
94104
Original file line number Diff line number Diff line change 11import  *  as  ADCSDK  from  '@api7/adc-sdk' ; 
22import  {  Listr ,  SilentRenderer  }  from  'listr2' ; 
3+ import  *  as  semver  from  'semver' ; 
34
45import  {  BackendAPI7  }  from  '../../src' ; 
56
@@ -101,7 +102,7 @@ export const conditionalDescribe = (cond: cond) =>
101102export  const  conditionalIt  =  ( cond : cond )  =>  ( cond  ? it  : it . skip ) ; 
102103
103104export  const  semverCondition  =  ( 
104-   op : ( v1 : string ,  v2 : string )  =>  boolean , 
105+   op : ( v1 : string ,  v2 : string   |   semver . SemVer )  =>  boolean , 
105106  target : string , 
106-   base  =  process . env . BACKEND_API7_VERSION  ??  '0.0.0' , 
107+   base  =  semver . coerce ( process . env . BACKEND_API7_VERSION )  ??  '0.0.0' , 
107108)  =>  op ( target ,  base ) ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments