@@ -11,7 +11,7 @@ import chalk from "chalk";
1111import helpers from "yeoman-test" ;
1212
1313const { copy, existsSync, readJson, writeJson } = fsExtra ;
14- const { ls, mkdir, rm, tempdir } = shelljs
14+ const { ls, mkdir, rm, tempdir } = shelljs ;
1515
1616const LIMIT_TESTS = ! ! process . env . LIMIT_TESTS ;
1717const PARALLELISM = 4 ;
@@ -30,16 +30,16 @@ const CONFIGS = [
3030] ;
3131
3232const COLORS = [
33- ' green' ,
34- ' yellow' ,
35- ' blue' ,
36- ' magenta' ,
37- ' cyan' ,
38- ' greenBright' ,
39- ' yellowBright' ,
40- ' blueBright' ,
41- ' magentaBright' ,
42- ' cyanBright' ,
33+ " green" ,
34+ " yellow" ,
35+ " blue" ,
36+ " magenta" ,
37+ " cyan" ,
38+ " greenBright" ,
39+ " yellowBright" ,
40+ " blueBright" ,
41+ " magentaBright" ,
42+ " cyanBright"
4343] ;
4444
4545if ( LIMIT_TESTS ) {
@@ -56,9 +56,9 @@ main().catch(e => {
5656async function main ( ) {
5757 console . log ( "Preparing..." ) ;
5858
59- const pluggableWidgetsToolsPath = join ( DIR_COMMAND_TESTS , "../pluggable-widgets-tools" )
60- const pluggableWidgetsToolsVersion = ( await readJson ( join ( pluggableWidgetsToolsPath , "package.json" ) ) ) . version
61- console . log ( "Preparing: Packaging @mendix/pluggable-widgets-tools version %s" , pluggableWidgetsToolsVersion )
59+ const pluggableWidgetsToolsPath = join ( DIR_COMMAND_TESTS , "../pluggable-widgets-tools" ) ;
60+ const pluggableWidgetsToolsVersion = ( await readJson ( join ( pluggableWidgetsToolsPath , "package.json" ) ) ) . version ;
61+ console . log ( "Preparing: Packaging @mendix/pluggable-widgets-tools version %s" , pluggableWidgetsToolsVersion ) ;
6262 const { stdout : packOutput } = await execAsync ( "npm pack" , pluggableWidgetsToolsPath , m => console . log ( m ) ) ;
6363 const toolsPackagePath = join ( pluggableWidgetsToolsPath , packOutput . trim ( ) . split ( / \n / g) . pop ( ) ) ;
6464
@@ -68,7 +68,7 @@ async function main() {
6868 await Promise . all (
6969 CONFIGS . map ( async ( config , index ) => {
7070 const logger = getWidgetLogger ( index , ...config ) ;
71- logger ( "Scheduled, waiting for lock" )
71+ logger ( "Scheduled, waiting for lock" ) ;
7272 const [ , release ] = await workDirSemaphore . acquire ( ) ;
7373 let workDir ;
7474 try {
@@ -83,7 +83,7 @@ async function main() {
8383 await runTest ( workDir , logger , ...config ) ;
8484 return undefined ;
8585 } catch ( e ) {
86- logger ( chalk . bold . red ( "Stopped with error" ) )
86+ logger ( chalk . bold . red ( "Stopped with error" ) ) ;
8787 return [ config , e ] ;
8888 } finally {
8989 workDirs . push ( workDir ) ;
@@ -93,7 +93,7 @@ async function main() {
9393 )
9494 ) . filter ( f => f ) ;
9595
96- console . log ( "Cleaning up temporary files" )
96+ console . log ( "Cleaning up temporary files" ) ;
9797 try {
9898 rm ( "-rf" , toolsPackagePath , ...workDirs ) ;
9999 } catch ( error ) {
@@ -109,7 +109,7 @@ async function main() {
109109
110110 async function runTest ( workDir , logger , platform , boilerplate , lang , version ) {
111111 const isNative = platform === "native" ;
112- const widgetName = getWidgetName ( platform , boilerplate , lang , version )
112+ const widgetName = getWidgetName ( platform , boilerplate , lang , version ) ;
113113 let widgetPackageJson ;
114114
115115 logger ( `Preparing widget...` ) ;
@@ -275,8 +275,8 @@ async function main() {
275275 ? "@mendix/pluggable-widgets-tools"
276276 : null
277277 : boilerplate === "full"
278- ? "classnames"
279- : null ;
278+ ? "classnames"
279+ : null ;
280280
281281 if (
282282 packageName &&
@@ -323,15 +323,15 @@ async function main() {
323323 } finally {
324324 try {
325325 await promisify ( kill ) ( startProcess . pid , "SIGKILL" ) ;
326- } catch ( _ ) {
327- console . warn ( `[${ widgetName } ] Error while killing start process` ) ;
326+ } catch ( e ) {
327+ console . warn ( `[${ widgetName } ] Error while killing start process: ${ e } ` ) ;
328328 }
329329 await new Promise ( resolve => setTimeout ( resolve , 5000 ) ) ; // give time for processes to die
330330 }
331331 }
332332
333333 async function testNativeDependencyManagement ( ) {
334- const NATIVE_MAPS_VERSION = "0.31.1"
334+ const NATIVE_MAPS_VERSION = "0.31.1" ;
335335 await execAsync ( `npm install react-native-maps@${ NATIVE_MAPS_VERSION } ` , workDir , logger ) ;
336336 const entryPointPath = join ( workDir , "src" , `Generated.${ lang } x` ) ;
337337 const jsonPath = join ( workDir , `/dist/tmp/widgets/${ widgetPackageJson . widgetName } .json` ) ;
@@ -368,14 +368,13 @@ async function main() {
368368 }
369369}
370370
371-
372371function getWidgetName ( platform , boilerplate , lang , version ) {
373372 return `[generated_${ version . replace ( "." , "_" ) } _${ lang } _${ platform } _${ boilerplate } ]` ;
374373}
375374
376375function getWidgetLogger ( index , platform , boilerplate , lang , version ) {
377- const color = chalk [ COLORS [ index % COLORS . length ] ]
378- return ( ...msgs ) => console . log ( color ( getWidgetName ( platform , boilerplate , lang , version ) ) , ...msgs )
376+ const color = chalk [ COLORS [ index % COLORS . length ] ] ;
377+ return ( ...msgs ) => console . log ( color ( getWidgetName ( platform , boilerplate , lang , version ) ) , ...msgs ) ;
379378}
380379
381380/**
@@ -388,7 +387,7 @@ function getWidgetLogger(index, platform, boilerplate, lang, version) {
388387 * ```
389388 */
390389function resolveModule ( packageName ) {
391- return fileURLToPath ( import . meta. resolve ( packageName ) )
390+ return fileURLToPath ( import . meta. resolve ( packageName ) ) ;
392391}
393392
394393async function execAsync ( command , workDir , logger ) {
@@ -407,6 +406,7 @@ async function execAsync(command, workDir, logger) {
407406async function execFailedAsync ( command , workDir ) {
408407 try {
409408 await promisify ( exec ) ( command , { cwd : workDir } ) ;
409+ // eslint-disable-next-line no-unused-vars
410410 } catch ( _ ) {
411411 return ;
412412 }
@@ -422,7 +422,7 @@ function fixPackageJson(json) {
422422 "@types/react-test-renderer" : "~18.0.0"
423423 } ;
424424 const overrides = {
425- " react" : "^19.0.0" ,
425+ react : "^19.0.0" ,
426426 "react-dom" : "^19.0.0" ,
427427 "react-native" : "0.78.2"
428428 } ;
0 commit comments