diff --git a/README.md b/README.md index a126e06..dfac116 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ # Episode 147 - Testing Firestore Rules with the Emulator Learn how to test your Firebase security rules using the new Cloud Firestore emulator. + + +### changelog +Fixing permission errors when adding mock data to firestore +as seen in https://github.com/AngularFirebase/147-firestore-emulator-rules-testing/issues/1 diff --git a/spec/helpers.js b/spec/helpers.js index 8ee85f0..62787eb 100644 --- a/spec/helpers.js +++ b/spec/helpers.js @@ -9,11 +9,12 @@ module.exports.setup = async (auth, data) => { }); const db = app.firestore(); + const dbAdmin = firebase.initializeAdminApp({projectId}).firestore(); // Write mock documents before rules if (data) { for (const key in data) { - const ref = db.doc(key); + const ref = dbAdmin.doc(key); await ref.set(data[key]); } }