1- import * as fs from 'fs'
2- import * as path from 'path'
3-
4- import { getTempDir } from './utils.js'
5-
61describe ( 'stacks/utils.ts' , ( ) => {
72 let envOrig : string
83 let utils : typeof import ( '../stacks/utils.js' )
@@ -17,31 +12,6 @@ describe('stacks/utils.ts', () => {
1712 process . env = JSON . parse ( envOrig )
1813 } )
1914
20- it ( 'getEnvironment (without process.env)' , ( ) => {
21- const tmpDir = getTempDir ( )
22- const data = 'MOCK=mymock'
23-
24- fs . writeFileSync ( path . join ( tmpDir , '.env' ) , data )
25-
26- const environment = utils . getEnvironment ( tmpDir )
27- expect ( environment . parsed ) . toEqual ( { MOCK : 'mymock' } )
28-
29- fs . rmSync ( tmpDir , { recursive : true , force : true } )
30- } )
31-
32- it ( 'getEnvironment (with process.env)' , ( ) => {
33- process . env [ 'MOCK' ] = 'anothermock'
34- const tmpDir = getTempDir ( )
35- const data = 'MOCK=mymock'
36-
37- fs . writeFileSync ( path . join ( tmpDir , '.env' ) , data )
38-
39- const environment = utils . getEnvironment ( tmpDir )
40- expect ( environment . parsed ) . toEqual ( { MOCK : 'anothermock' } )
41-
42- fs . rmSync ( tmpDir , { recursive : true , force : true } )
43- } )
44-
4515 it ( 'NameRegister.registerName' , ( ) => {
4616 const nameRegister = utils . NameRegister . getInstance ( )
4717 const expected = 'a'
0 commit comments