Skip to content

Commit b97dd4e

Browse files
Fix useEmulators argument validation (#4901)
* Fix useEmulators argument validation * Create silent-planets-raise.md
1 parent 96a4709 commit b97dd4e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/silent-planets-raise.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@firebase/rules-unit-testing": patch
3+
---
4+
5+
Allow using useEmulators() with only the storage configuration.

packages/rules-unit-testing/src/api/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,9 @@ export function initializeAdminApp(options: AdminAppOptions): app.App {
263263
* @param options options object.
264264
*/
265265
export function useEmulators(options: FirebaseEmulatorOptions): void {
266-
if (!(options.database || options.firestore || options.hub)) {
266+
if (!(options.database || options.firestore || options.storage || options.hub)) {
267267
throw new Error(
268-
"Argument to useEmulators must contain at least one of 'database', 'firestore', or 'hub'."
268+
"Argument to useEmulators must contain at least one of 'database', 'firestore', 'storage', or 'hub'."
269269
);
270270
}
271271

0 commit comments

Comments
 (0)