Skip to content

Fix useEmulators argument validation #4901

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/silent-planets-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@firebase/rules-unit-testing": patch
---

Allow using useEmulators() with only the storage configuration.
4 changes: 2 additions & 2 deletions packages/rules-unit-testing/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ export function initializeAdminApp(options: AdminAppOptions): app.App {
* @param options options object.
*/
export function useEmulators(options: FirebaseEmulatorOptions): void {
if (!(options.database || options.firestore || options.hub)) {
if (!(options.database || options.firestore || options.storage || options.hub)) {
throw new Error(
"Argument to useEmulators must contain at least one of 'database', 'firestore', or 'hub'."
"Argument to useEmulators must contain at least one of 'database', 'firestore', 'storage', or 'hub'."
);
}

Expand Down