@@ -112,6 +112,18 @@ export function load(yamlPath: string): yaml.Document {
112112 return yaml . parseDocument ( raw ) ;
113113}
114114
115+ // We must go through the exports object for stubbing to work in tests.
116+ const dynamicDispatch = exports as {
117+ discoverBackendRoot : typeof discoverBackendRoot ;
118+ load : typeof load ;
119+ findEnv : typeof findEnv ;
120+ upsertEnv : typeof upsertEnv ;
121+ store : typeof store ;
122+ overrideChosenEnv : typeof overrideChosenEnv ;
123+ listAppHostingFilesInPath : typeof listAppHostingFilesInPath ;
124+ getAppHostingConfiguration : typeof getAppHostingConfiguration ;
125+ } ;
126+
115127/**
116128 * Loads in apphosting.yaml, apphosting.emulator.yaml & apphosting.local.yaml as an
117129 * overriding union. In order to keep apphosting.emulator.yaml safe to commit,
@@ -193,18 +205,6 @@ export function upsertEnv(document: yaml.Document, env: Env): void {
193205 envs . add ( envYaml ) ;
194206}
195207
196- // We must go through the exports object for stubbing to work in tests.
197- const dynamicDispatch = exports as {
198- discoverBackendRoot : typeof discoverBackendRoot ;
199- load : typeof load ;
200- findEnv : typeof findEnv ;
201- upsertEnv : typeof upsertEnv ;
202- store : typeof store ;
203- overrideChosenEnv : typeof overrideChosenEnv ;
204- listAppHostingFilesInPath : typeof listAppHostingFilesInPath ;
205- getAppHostingConfiguration : typeof getAppHostingConfiguration ;
206- } ;
207-
208208/**
209209 * Given a secret name, guides the user whether they want to add that secret to the specified apphosting yaml file.
210210 * If an the file exists and includes the secret already is used as a variable name, exist early.
0 commit comments