File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -151,8 +151,11 @@ describe('findPyPyVersion', () => {
151151 let spyChmodSync : jest . SpyInstance ;
152152 let spyCoreAddPath : jest . SpyInstance ;
153153 let spyCoreExportVariable : jest . SpyInstance ;
154+ const env = process . env ;
154155
155156 beforeEach ( ( ) => {
157+ jest . resetModules ( ) ;
158+ process . env = { ...env } ;
156159 tcFind = jest . spyOn ( tc , 'find' ) ;
157160 tcFind . mockImplementation ( ( tool : string , version : string ) => {
158161 const semverRange = new semver . Range ( version ) ;
@@ -214,6 +217,7 @@ describe('findPyPyVersion', () => {
214217 jest . resetAllMocks ( ) ;
215218 jest . clearAllMocks ( ) ;
216219 jest . restoreAllMocks ( ) ;
220+ process . env = env ;
217221 } ) ;
218222
219223 it ( 'found PyPy in toolcache' , async ( ) => {
Original file line number Diff line number Diff line change @@ -28,17 +28,20 @@ const manifestData = require('./data/versions-manifest.json');
2828describe ( 'Finder tests' , ( ) => {
2929 let spyCoreAddPath : jest . SpyInstance ;
3030 let spyCoreExportVariable : jest . SpyInstance ;
31+ const env = process . env ;
3132
3233 beforeEach ( ( ) => {
34+ jest . resetModules ( ) ;
35+ process . env = { ...env } ;
3336 spyCoreAddPath = jest . spyOn ( core , 'addPath' ) ;
34-
3537 spyCoreExportVariable = jest . spyOn ( core , 'exportVariable' ) ;
3638 } ) ;
3739
3840 afterEach ( ( ) => {
3941 jest . resetAllMocks ( ) ;
4042 jest . clearAllMocks ( ) ;
4143 jest . restoreAllMocks ( ) ;
44+ process . env = env ;
4245 } ) ;
4346
4447 it ( 'Finds Python if it is installed' , async ( ) => {
@@ -66,7 +69,6 @@ describe('Finder tests', () => {
6669 await finder . useCpythonVersion ( '3.x' , 'x64' , false ) ;
6770 expect ( spyCoreAddPath ) . not . toHaveBeenCalled ( ) ;
6871 expect ( spyCoreExportVariable ) . not . toHaveBeenCalled ( ) ;
69- expect ( spyCoreExportVariable ) . not . toHaveBeenCalled ( ) ;
7072 } ) ;
7173
7274 it ( 'Finds stable Python version if it is not installed, but exists in the manifest' , async ( ) => {
You can’t perform that action at this time.
0 commit comments