- Notifications
You must be signed in to change notification settings - Fork 988
Closed
Labels
Description
Describe your environment
- Operating System version: Windows 10
- Browser version: Chrome 90
- Firebase SDK version: @firebase/rules-unit-testing v. 1.3.2 + newest emulators
- Firebase Product: storage
Describe the problem
When trying to test storage rules, I cannot initialize the test app, supplying the storageBucket parameter. I get the following error: TypeError: app.storage is not a function
This should be the minimal code example:
import * as fbTesting from "@firebase/rules-unit-testing"; const app = fbTesting.initializeTestApp({ projectId: MY_PROJECT_ID, storageBucket: MY_STORAGE_BUCKET, auth: MY_AUTH}) If I use the admin app instead fbTesting.initializeAdminApp(...), I can use the storageBucket parameter and write to the emulator.
I read in a few posts, that it is necessary to import firebase/storage, but this happens here:
| import 'firebase/storage'; |