@@ -5,7 +5,9 @@ contributing to the Firebase JavaScript SDK (including Cloud Firestore).
5
5
Follow instructions there to install dependencies, build the SDK, and set up
6
6
the testing environment.
7
7
8
- ## Setting up a project for testing
8
+ ## Integration Testing
9
+
10
+ ### Setting up a project for testing
9
11
10
12
You will need a production project to test the Firestore SDK. You can create
11
13
a new project by visiting the
16
18
[ Automated Setup] ( https://github.com/firebase/firebase-js-sdk#automated-setup )
17
19
for more details.
18
20
21
+ ### Setting up the Firestore emulator
22
+
23
+ The integration tests require that the Firestore emulator is running
24
+ on port 8080, which is default when running it via CLI.
25
+
26
+ * [ Install the Firebase CLI] ( https://firebase.google.com/docs/cli/ ) .
27
+ ```
28
+ npm install -g firebase-tools
29
+ ```
30
+ * [Install the Firestore
31
+ emulator](https://firebase.google.com/docs/firestore/security/test-rules-emulator#install_the_emulator).
32
+ ```
33
+ firebase setup:emulators:firestore
34
+ ```
35
+ * Run the emulator
36
+ ```
37
+ firebase serve --only firestore
38
+ ```
19
39
20
- ## Running Firestore Tests
40
+ ### Running Firestore Tests
21
41
22
- All commands must be run from this ` packages/firestore/ ` directory.
42
+ All commands must be run from the `packages/firestore/` directory.
23
43
24
44
```
25
45
# Come up to date on dependencies after performing git pull
@@ -43,7 +63,14 @@ yarn test:browser --integration
43
63
# localhost:8080.
44
64
yarn test: browser --integration --local
45
65
66
+ # Run all node tests once (unit and integration) against the emulator.
67
+ yarn test: node
68
+
46
69
# Run a subset of tests whose names match a filter.
47
70
yarn test: browser --grep 'SortedSet keeps elements in the right order'
48
71
yarn test: node --grep 'SortedSet keeps elements in the right order'
72
+
73
+ # Run tests against the production backend.
74
+ yarn test:node: prod
75
+ yarn test:node:persistence: prod
49
76
```
0 commit comments