Skip to content

Commit 9aa6b09

Browse files
committed
Merge remote-tracking branch 'origin/next' into esm-js-extensions
2 parents 0b12e4d + 337b47d commit 9aa6b09

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

spec/v1/config.spec.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,14 @@ import { config } from "../../src/v1/config";
2626

2727
describe("config()", () => {
2828
it("throws an error with migration guidance", () => {
29-
expect(config).to.throw(
29+
expect(() => {
30+
// @ts-expect-error - config is deprecated and typed as never to cause a build error
31+
config();
32+
}).to.throw(
3033
Error,
3134
"functions.config() has been removed in firebase-functions v7. " +
3235
"Migrate to environment parameters using the params module. " +
3336
"Migration guide: https://firebase.google.com/docs/functions/config-env#migrate-config"
3437
);
3538
});
36-
});
39+
});

src/v1/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ export { firebaseConfig } from "../common/config";
2727
* Migrate to environment parameters using the `params` module immediately.
2828
* Migration guide: https://firebase.google.com/docs/functions/config-env#migrate-config
2929
*/
30-
export function config(): Record<string, any> {
30+
export const config: never = (() => {
3131
throw new Error(
3232
"functions.config() has been removed in firebase-functions v7. " +
3333
"Migrate to environment parameters using the params module. " +
3434
"Migration guide: https://firebase.google.com/docs/functions/config-env#migrate-config"
3535
);
36-
}
36+
}) as never;

0 commit comments

Comments
 (0)