Skip to content

Commit 22a5ea5

Browse files
committed
feat: add SecretManager mocking
1 parent a4d2de0 commit 22a5ea5

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/main.ts

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ type HttpsFunctionOrCloudFunctionV1<T, U> = U extends HttpsFunction &
4545
? HttpsFunction & Runnable<T>
4646
: CloudFunctionV1<T>;
4747

48+
export { mockSecretManager } from './secretManager';
49+
4850
// Re-exporting V1 (to reduce breakage)
4951
export {
5052
ContextOptions,

src/secretManager.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/** Mock values returned by `functions.config()`. */
2+
export function mockSecretManager(conf: { [key: string]: any }) {
3+
for (const [key, value] of Object.entries(conf)) {
4+
process.env[key] = value;
5+
}
6+
}

0 commit comments

Comments
 (0)