Skip to content

Commit 52a4cdf

Browse files
authored
Update the test:setup script to configure firestore settings (#240)
* Update test:setup command to configure firestore * [AUTOMATED]: Prettier Code Styling * Add required "indexes" field * Update the README.md for firestore
1 parent b7566d1 commit 52a4cdf

File tree

4 files changed

+28
-9
lines changed

4 files changed

+28
-9
lines changed

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,26 @@ $ yarn
6666
A production project is required to test the Firebase JS SDK. You can create a
6767
new project by visiting the [Firebase Console](https://console.firebase.google.com/).
6868

69+
#### Firestore Support
70+
71+
Visit the database section of the console and enable the Cloud Firestore Beta.
72+
You can select either of the default permissions settings as we will overwrite
73+
them below.
74+
75+
#### Authentication Support
76+
77+
Visit the authentication config in your project and enable the `Anonymous`
78+
sign-in provider to complete your project config.
79+
6980
#### Automated Setup
7081

71-
Most of the test setup can be done by running the following command at the root
72-
of the package:
82+
The remainder of the test setup can be done by running the following command at
83+
the root of the package:
7384

7485
```bash
7586
yarn test:setup
7687
```
7788

78-
#### Authentication Support
79-
80-
This is the only piece of config that must be done manually. Visit the
81-
authentication config in your project and enable the `Anonymous` sign-in
82-
provider to complete your project config.
83-
8489
### Running the tests
8590

8691
Each of the directories in the `integration` directory as well as the `packages`

config/firebase.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
22
"database": {
33
"rules": "database.rules.json"
4+
},
5+
"firestore": {
6+
"rules": "firestore.rules",
7+
"indexes": "firestore.indexes.json"
48
}
5-
}
9+
}

config/firestore.indexes.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"indexes": []
3+
}

config/firestore.rules

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
service cloud.firestore {
2+
match /databases/{database}/documents {
3+
match /{document=**} {
4+
allow read, write;
5+
}
6+
}
7+
}

0 commit comments

Comments
 (0)