File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -163,16 +163,21 @@ describe("LintResultCache", () => {
163163 it ( "contains node version during hashing" , ( ) => {
164164 const version = "node-=-version" ;
165165
166- sandbox . stub ( process , "version" ) . value ( version ) ;
167- const NewLintResultCache = proxyquire ( "../../../lib/cli-engine/lint-result-cache.js" , {
168- "./hash" : hashStub
169- } ) ;
170- const newLintResultCache = new NewLintResultCache ( cacheFileLocation , "metadata" ) ;
166+ const versionStub = sandbox . stub ( process , "version" ) . value ( version ) ;
171167
172- newLintResultCache . getCachedLintResults ( filePath , fakeConfig ) ;
168+ try {
169+ const NewLintResultCache = proxyquire ( "../../../lib/cli-engine/lint-result-cache.js" , {
170+ "./hash" : hashStub
171+ } ) ;
172+ const newLintResultCache = new NewLintResultCache ( cacheFileLocation , "metadata" ) ;
173173
174- assert . ok ( hashStub . calledOnce ) ;
175- assert . ok ( hashStub . calledWithMatch ( version ) ) ;
174+ newLintResultCache . getCachedLintResults ( filePath , fakeConfig ) ;
175+
176+ assert . ok ( hashStub . calledOnce ) ;
177+ assert . ok ( hashStub . calledWithMatch ( version ) ) ;
178+ } finally {
179+ versionStub . restore ( ) ;
180+ }
176181 } ) ;
177182 } ) ;
178183
You can’t perform that action at this time.
0 commit comments