Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions spec/v1/config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ import { config } from "../../src/v1/config";

describe("config()", () => {
it("throws an error with migration guidance", () => {
expect(config).to.throw(
expect(() => {
// @ts-expect-error - config is deprecated and typed as never to cause a build error
config();
}).to.throw(
Error,
"functions.config() has been removed in firebase-functions v7. " +
"Migrate to environment parameters using the params module. " +
"Migration guide: https://firebase.google.com/docs/functions/config-env#migrate-config"
);
});
});
});
4 changes: 2 additions & 2 deletions src/v1/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ export { firebaseConfig } from "../common/config";
* Migrate to environment parameters using the `params` module immediately.
* Migration guide: https://firebase.google.com/docs/functions/config-env#migrate-config
*/
export function config(): Record<string, any> {
export const config: never = (() => {
throw new Error(
"functions.config() has been removed in firebase-functions v7. " +
"Migrate to environment parameters using the params module. " +
"Migration guide: https://firebase.google.com/docs/functions/config-env#migrate-config"
);
}
}) as never;
Loading