33 * Licensed under the MIT License. See LICENSE in the project root for license information.
44 *--------------------------------------------------------*/
55
6- import * as assert from 'assert' ;
6+ import assert from 'assert' ;
77import * as path from 'path' ;
88import * as fs from 'fs' ;
99import * as os from 'os' ;
@@ -18,21 +18,7 @@ suite('parseEnvFiles Tests', () => {
1818
1919 teardown ( ( ) => {
2020 if ( tmpDir && fs . existsSync ( tmpDir ) ) {
21- // Use rmdir for compatibility with older Node.js versions
22- const rimraf = ( dir : string ) => {
23- if ( fs . existsSync ( dir ) ) {
24- fs . readdirSync ( dir ) . forEach ( ( file ) => {
25- const curPath = path . join ( dir , file ) ;
26- if ( fs . lstatSync ( curPath ) . isDirectory ( ) ) {
27- rimraf ( curPath ) ;
28- } else {
29- fs . unlinkSync ( curPath ) ;
30- }
31- } ) ;
32- fs . rmdirSync ( dir ) ;
33- }
34- } ;
35- rimraf ( tmpDir ) ;
21+ fs . rmSync ( tmpDir , { recursive : true } ) ;
3622 }
3723 } ) ;
3824
@@ -46,14 +32,6 @@ suite('parseEnvFiles Tests', () => {
4632 assert . deepStrictEqual ( result , { } ) ;
4733 } ) ;
4834
49- test ( 'should handle single string input' , ( ) => {
50- const envFile = path . join ( tmpDir , 'single.env' ) ;
51- fs . writeFileSync ( envFile , 'SINGLE_VAR=single_value' ) ;
52-
53- const result = parseEnvFiles ( envFile ) ;
54- assert . strictEqual ( result . SINGLE_VAR , 'single_value' ) ;
55- } ) ;
56-
5735 test ( 'should handle array of files' , ( ) => {
5836 const envFile1 = path . join ( tmpDir , 'first.env' ) ;
5937 const envFile2 = path . join ( tmpDir , 'second.env' ) ;
0 commit comments