@@ -120,6 +120,35 @@ describe("LintResultCache", () => {
120120 lintResultsCache = new LintResultCache ( cacheFileLocation ) ;
121121 } ) ;
122122
123+ describe ( "when calculating the hashing" , ( ) => {
124+ it ( "contains eslint version during hashing" , ( ) => {
125+ const version = "eslint-=-version" ;
126+ const NewLintResultCache = proxyquire ( "../../../lib/cli-engine/lint-result-cache.js" , {
127+ "../../package.json" : { version } ,
128+ "./hash" : hashStub
129+ } ) ;
130+ const newLintResultCache = new NewLintResultCache ( cacheFileLocation ) ;
131+
132+ newLintResultCache . getCachedLintResults ( filePath , fakeConfig ) ;
133+ assert . ok ( hashStub . calledOnce ) ;
134+ assert . ok ( hashStub . calledWithMatch ( version ) ) ;
135+ } ) ;
136+
137+ it ( "contains node version during hashing" , ( ) => {
138+ const version = "node-=-version" ;
139+
140+ sinon . stub ( process , "version" ) . value ( version ) ;
141+ const NewLintResultCache = proxyquire ( "../../../lib/cli-engine/lint-result-cache.js" , {
142+ "./hash" : hashStub
143+ } ) ;
144+ const newLintResultCache = new NewLintResultCache ( cacheFileLocation ) ;
145+
146+ newLintResultCache . getCachedLintResults ( filePath , fakeConfig ) ;
147+ assert . ok ( hashStub . calledOnce ) ;
148+ assert . ok ( hashStub . calledWithMatch ( version ) ) ;
149+ } ) ;
150+ } ) ;
151+
123152 describe ( "When file is changed" , ( ) => {
124153 beforeEach ( ( ) => {
125154 hashStub . returns ( hashOfConfig ) ;
0 commit comments