@@ -797,9 +797,10 @@ describe('Config Unit Tests', function() {
797
797
}
798
798
} ) ;
799
799
stubLoadPkgJson . returns ( { root : true , rules : { } } ) ;
800
- stubLoad . returns ( { rules : { 'require-name' : 'error' } } ) ;
800
+ stubLoad . returns ( { root : true , rules : { 'require-name' : 'error' } } ) ;
801
801
802
802
const expectedConfigObj = {
803
+ root : true ,
803
804
rules : {
804
805
'require-name' : 'error'
805
806
}
@@ -1031,7 +1032,8 @@ describe('Config Unit Tests', function() {
1031
1032
const stubLoadPkgJson = sinon . stub ( ConfigFile , 'loadFromPackageJson' ) ;
1032
1033
const stubLoad = sinon . stub ( ConfigFile , 'load' ) ;
1033
1034
1034
- stubDirname . returns ( './npm-package-json-lint/' ) ;
1035
+ stubDirname . onCall ( 0 ) . returns ( './npm-package-json-lint/' ) ;
1036
+ stubDirname . onCall ( 1 ) . returns ( '/home' ) ;
1035
1037
stubExists . returns ( false ) ;
1036
1038
1037
1039
const expectedConfigObj = {
@@ -1040,7 +1042,7 @@ describe('Config Unit Tests', function() {
1040
1042
const filePath = './package.json' ;
1041
1043
const result = config . getProjectHierarchyConfig ( filePath ) ;
1042
1044
1043
- stubDirname . calledOnce . should . be . true ;
1045
+ stubDirname . calledTwice . should . be . true ;
1044
1046
stubDirname . firstCall . calledWithExactly ( filePath ) . should . be . true ;
1045
1047
1046
1048
stubExists . calledThrice . should . be . true ;
@@ -1078,7 +1080,8 @@ describe('Config Unit Tests', function() {
1078
1080
const stubLoadPkgJson = sinon . stub ( ConfigFile , 'loadFromPackageJson' ) ;
1079
1081
const stubLoad = sinon . stub ( ConfigFile , 'load' ) ;
1080
1082
1081
- stubDirname . returns ( './npm-package-json-lint/' ) ;
1083
+ stubDirname . onCall ( 0 ) . returns ( './npm-package-json-lint/' ) ;
1084
+ stubDirname . onCall ( 1 ) . returns ( '/home' ) ;
1082
1085
stubExists . returns ( true ) ;
1083
1086
stubStats . returns ( {
1084
1087
isFile : function ( ) {
@@ -1095,7 +1098,7 @@ describe('Config Unit Tests', function() {
1095
1098
const filePath = './package.json' ;
1096
1099
const result = config . getProjectHierarchyConfig ( filePath ) ;
1097
1100
1098
- stubDirname . calledOnce . should . be . true ;
1101
+ stubDirname . calledTwice . should . be . true ;
1099
1102
stubDirname . firstCall . calledWithExactly ( filePath ) . should . be . true ;
1100
1103
1101
1104
stubExists . calledOnce . should . be . true ;
0 commit comments