@@ -4,6 +4,7 @@ const Promise = require("nodegit-promise");
44const promisify = require ( "promisify-node" ) ;
55const fse = promisify ( require ( "fs-extra" ) ) ;
66const testFilesPath = path . resolve ( __dirname , "../test/tests" ) ;
7+ const missingFileIgnores = require ( "./missing-tests-ignore" ) ;
78
89var output = { } ;
910
@@ -15,17 +16,25 @@ function findMissingTest(idef) {
1516 . then ( function ( file ) {
1617 var fieldsResult = [ ] ;
1718 var functionsResult = [ ] ;
19+ var fieldIgnores = ( missingFileIgnores [ idef . filename ] || { } ) . fields ;
20+ var functionIgnores = ( missingFileIgnores [ idef . filename ] || { } ) . functions ;
21+
22+ fieldIgnores = fieldIgnores || [ ] ;
23+ functionIgnores = functionIgnores || [ ] ;
24+ file = file || "" ;
1825
1926 idef . fields . forEach ( function ( field ) {
20- if ( file . indexOf ( field . jsFunctionName ) < 0 ) {
27+ if ( file . indexOf ( field . jsFunctionName ) < 0
28+ && fieldIgnores . indexOf ( field . jsFunctionName < 0 ) ) {
2129 fieldsResult . push ( field . jsFunctionName ) ;
2230 }
2331 } ) ;
2432
2533 result . fields = fieldsResult ;
2634
2735 idef . functions . forEach ( function ( fn ) {
28- if ( file . indexOf ( fn . jsFunctionName ) < 0 ) {
36+ if ( file . indexOf ( fn . jsFunctionName ) < 0
37+ && functionIgnores . indexOf ( fn . jsFunctionName ) < 0 ) {
2938 functionsResult . push ( fn . jsFunctionName ) ;
3039 }
3140 } ) ;
@@ -50,4 +59,6 @@ Promise.all(promises)
5059. then ( function ( ) {
5160 fse . writeFileSync ( path . join ( __dirname , "missing-tests.json" ) ,
5261 JSON . stringify ( output , null , 2 ) ) ;
62+ } , function ( fail ) {
63+ console . log ( fail ) ;
5364} ) ;
0 commit comments