File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
packages/cloudflare/src/cli/build/utils Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 1- import { writeFileSync } from "node:fs" ;
1+ import { appendFileSync , writeFileSync } from "node:fs" ;
22
33import { BuildOptions } from "@opennextjs/aws/build/helper.js" ;
44import mockFs from "mock-fs" ;
@@ -54,4 +54,17 @@ describe("extractProjectEnvVars", () => {
5454 ENV_VAR : "value" ,
5555 } ) ;
5656 } ) ;
57+
58+ it ( "should support referencing variables" , ( ) => {
59+ appendFileSync ( ".env.production.local" , "\nENV_PROD_LOCAL_VAR_REF=$ENV_PROD_LOCAL_VAR" ) ;
60+
61+ const result = extractProjectEnvVars ( "production" , options ) ;
62+ expect ( result ) . toEqual ( {
63+ ENV_LOCAL_VAR : "value" ,
64+ ENV_PROD_LOCAL_VAR : "value" ,
65+ ENV_PROD_LOCAL_VAR_REF : "value" ,
66+ ENV_PROD_VAR : "value" ,
67+ ENV_VAR : "value" ,
68+ } ) ;
69+ } ) ;
5770} ) ;
You can’t perform that action at this time.
0 commit comments