3
3
* Licensed under the MIT License. See LICENSE in the project root for license information.
4
4
*--------------------------------------------------------*/
5
5
6
- import * as assert from 'assert' ;
6
+ import assert from 'assert' ;
7
7
import * as path from 'path' ;
8
8
import * as fs from 'fs' ;
9
9
import * as os from 'os' ;
@@ -18,21 +18,7 @@ suite('parseEnvFiles Tests', () => {
18
18
19
19
teardown ( ( ) => {
20
20
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 } ) ;
36
22
}
37
23
} ) ;
38
24
@@ -46,14 +32,6 @@ suite('parseEnvFiles Tests', () => {
46
32
assert . deepStrictEqual ( result , { } ) ;
47
33
} ) ;
48
34
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
-
57
35
test ( 'should handle array of files' , ( ) => {
58
36
const envFile1 = path . join ( tmpDir , 'first.env' ) ;
59
37
const envFile2 = path . join ( tmpDir , 'second.env' ) ;
0 commit comments