@@ -5,6 +5,7 @@ import path from "path";
55import Dotenv , { FormatError , PathError } from "@/dotenv" ;
66
77const isWindows = process . platform === "win32" ;
8+ const isMacos = process . platform === "darwin" ;
89
910function withTmpDir ( fn : ( dir : string ) => void | Promise < void > ) {
1011 const dir = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , "dotenv-" ) ) ;
@@ -42,7 +43,7 @@ describe("Dotenv.parse format errors", () => {
4243 [ '_=FOO' , "Invalid character in variable name" ] ,
4344 ] ;
4445
45- if ( ! isWindows ) {
46+ if ( ! isWindows && ! isMacos ) {
4647 cases . push ( [ 'FOO=$((1dd2))' , "Issue expanding a command" ] ) ;
4748 }
4849
@@ -178,7 +179,7 @@ describe("Dotenv.parse happy paths", () => {
178179 expect ( d . parse ( data ) ) . toEqual ( expected ) ;
179180 } ) ;
180181
181- if ( ! isWindows ) {
182+ if ( ! isWindows && ! isMacos ) {
182183 const cmdCases : Array < [ string , Record < string , string > ] > = [
183184 [ 'FOO=$(echo foo)' , { FOO : 'foo' } ] ,
184185 [ 'FOO=$((1+2))' , { FOO : '3' } ] ,
@@ -198,7 +199,7 @@ describe("Dotenv.parse happy paths", () => {
198199 const d = new Dotenv ( ) ;
199200 let vals = d . parse ( "APP_ENV=dev\nTEST1=foo1_${APP_ENV}" ) ;
200201 expect ( vals . TEST1 ) . toBe ( "foo1_prod" ) ;
201- if ( ! isWindows ) {
202+ if ( ! isWindows && ! isMacos ) {
202203 vals = d . parse ( `APP_ENV=dev\nTEST2=foo2_$(/bin/sh -c 'echo $APP_ENV')` ) ;
203204 expect ( vals . TEST2 ) . toBe ( "foo2_prod" ) ;
204205 }
0 commit comments