You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/firestore/CONTRIBUTING.md
+98-50Lines changed: 98 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,70 +7,118 @@ the testing environment.
7
7
8
8
## Integration Testing
9
9
10
-
### Setting up a project for testing
10
+
### Setting up the Firestore emulator
11
11
12
-
You will need a production project to test the Firestore SDK. You can create
13
-
a new project by visiting the
14
-
[Firebase Console](https://console.firebase.google.com/). Make sure that the
15
-
project has Cloud Firestore enabled in the database section of the console.
12
+
Integration tests that run against the Firestore emulator expect
13
+
that it runs on port 8080.
14
+
15
+
-[Install the Firebase CLI](https://firebase.google.com/docs/cli/).
16
+
```bash
17
+
npm install -g firebase-tools
18
+
```
19
+
-[Install the Firestore emulator](https://firebase.google.com/docs/firestore/security/test-rules-emulator#install_the_emulator).
20
+
```bash
21
+
firebase setup:emulators:firestore
22
+
```
23
+
- Run the emulator:
24
+
```bash
25
+
firebase emulators:start --only firestore
26
+
```
27
+
28
+
## Testing Firestore
29
+
30
+
Testing Firestore is organized along three dimensions:
31
+
32
+
1.**Environment**: Where the code runs.
33
+
-**Node.js**: Fast, V8-based testing using Mocha. Perfect for logic that doesn't require a browser.
34
+
-**Browsers**: Uses Karma to run tests in real browser engines (Chrome, Firefox, WebKit). Essential for testing IndexedDB and WebChannels.
35
+
2.**SDK Type**: Which version of the SDK is being tested.
36
+
-**Full SDK**: Includes real-time listeners, offline persistence, and caching.
37
+
-**Lite SDK**: A REST-only, lightweight version without persistence or real-time support.
38
+
3.**Backend**: Which server the tests communicate with.
39
+
-**Emulator**: Local server (default).
40
+
-**Production**: The live Firebase backend.
41
+
-**Nightly**: Pre-release backend for catching upcoming server changes.
42
+
43
+
### Running Tests
44
+
45
+
All commands must be run from the `packages/firestore/` directory.
0 commit comments