@@ -14,21 +14,12 @@ assert.strictEqual(binding2.hello(), 'world');
1414{
1515 const warningMessage = '#warning "NAPI_EXPERIMENTAL is enabled. Experimental features may be unstable."' ;
1616
17- const gccLogFilePath = path . resolve ( __dirname , './build_logs/build_gcc .log' ) ;
18- const gccLogContent = fs . readFileSync ( gccLogFilePath , 'utf8' ) ;
17+ const logFilePath = path . resolve ( __dirname , './logs/build .log' ) ;
18+ const logContent = fs . readFileSync ( logFilePath , 'utf8' ) ;
1919
20- const gccWarningCount = gccLogContent . split ( warningMessage ) . length - 1 ;
21- const gccHasWarning = gccLogContent . includes ( warningMessage ) ;
20+ const warningCount = logContent . split ( warningMessage ) . length - 1 ;
21+ const hasWarning = logContent . includes ( warningMessage ) ;
2222
23- assert . strictEqual ( gccHasWarning , true , `Expected warning not found: "${ warningMessage } "` ) ;
24- assert . strictEqual ( gccWarningCount , 1 , `Expected warning to appear exactly once, but found ${ gccWarningCount } occurrences.` ) ;
25-
26- const clangLogFilePath = path . resolve ( __dirname , './build_logs/build_clang.log' ) ;
27- const clangLogContent = fs . readFileSync ( clangLogFilePath , 'utf8' ) ;
28-
29- const clangWarningCount = clangLogContent . split ( warningMessage ) . length - 1 ;
30- const clangHasWarning = clangLogContent . includes ( warningMessage ) ;
31-
32- assert . strictEqual ( clangHasWarning , true , `Expected warning not found: "${ warningMessage } "` ) ;
33- assert . strictEqual ( clangWarningCount , 1 , `Expected warning to appear exactly once, but found ${ gccWarningCount } occurrences.` ) ;
23+ assert . strictEqual ( hasWarning , true , `Expected warning not found: "${ warningMessage } "` ) ;
24+ assert . strictEqual ( warningCount , 1 , `Expected warning to appear exactly once, but found ${ warningCount } occurrences.` ) ;
3425}
0 commit comments