@@ -66,32 +66,13 @@ suite('getTempDir tests', () => {
6666 process . env = originalEnv ;
6767 } ) ;
6868
69- test ( 'should use os.tmpdir on Windows' , async ( ) => {
70- // Force platform to be Windows
71- Object . defineProperty ( process , 'platform' , { value : 'win32' } ) ;
72-
73- const tmpDirStub = sandbox . stub ( os , 'tmpdir' ) . returns ( '/windows/temp/path' ) ;
74-
75- const testIds = [ 'test1' , 'test2' , 'test3' ] ;
76- sandbox . stub ( fs . promises , 'access' ) . resolves ( ) ;
77- sandbox . stub ( fs . promises , 'writeFile' ) . resolves ( ) ;
78-
79- // This will use getTempDir internally
80- const result = await writeTestIdsFile ( testIds ) ;
81-
82- assert . ok ( result . startsWith ( '/windows/temp/path' ) ) ;
83- assert . strictEqual ( tmpDirStub . callCount , 1 ) ;
84- } ) ;
85-
8669 test ( 'should use XDG_RUNTIME_DIR on non-Windows if available' , async ( ) => {
8770 // Force platform to be Linux
8871 Object . defineProperty ( process , 'platform' , { value : 'linux' } ) ;
8972
9073 // Set up XDG_RUNTIME_DIR
9174 process . env = { ...process . env , XDG_RUNTIME_DIR : '/xdg/runtime/dir' } ;
9275
93- const tmpDirStub = sandbox . stub ( os , 'tmpdir' ) . returns ( '/fallback/tmp/dir' ) ;
94-
9576 const testIds = [ 'test1' , 'test2' , 'test3' ] ;
9677 sandbox . stub ( fs . promises , 'access' ) . resolves ( ) ;
9778 sandbox . stub ( fs . promises , 'writeFile' ) . resolves ( ) ;
@@ -100,27 +81,5 @@ suite('getTempDir tests', () => {
10081 const result = await writeTestIdsFile ( testIds ) ;
10182
10283 assert . ok ( result . startsWith ( '/xdg/runtime/dir' ) ) ;
103- assert . strictEqual ( tmpDirStub . callCount , 0 ) ; // tmpdir should not be called
104- } ) ;
105-
106- test ( 'should fall back to os.tmpdir on non-Windows if XDG_RUNTIME_DIR not available' , async ( ) => {
107- // Force platform to be macOS
108- Object . defineProperty ( process , 'platform' , { value : 'darwin' } ) ;
109-
110- // Ensure XDG_RUNTIME_DIR is not set
111- process . env = { ...process . env } ;
112- delete process . env . XDG_RUNTIME_DIR ;
113-
114- const tmpDirStub = sandbox . stub ( os , 'tmpdir' ) . returns ( '/fallback/tmp/dir' ) ;
115-
116- const testIds = [ 'test1' , 'test2' , 'test3' ] ;
117- sandbox . stub ( fs . promises , 'access' ) . resolves ( ) ;
118- sandbox . stub ( fs . promises , 'writeFile' ) . resolves ( ) ;
119-
120- // This will use getTempDir internally
121- const result = await writeTestIdsFile ( testIds ) ;
122-
123- assert . ok ( result . startsWith ( '/fallback/tmp/dir' ) ) ;
124- assert . strictEqual ( tmpDirStub . callCount , 1 ) ;
12584 } ) ;
12685} ) ;
0 commit comments