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: README.md
+46-11Lines changed: 46 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,8 +16,8 @@ To get started using Firebase, see
16
16
17
17
### Prerequisites
18
18
19
-
Before you can start working on the Firebase JS SDK, you need to have Node.js 6.0 or
20
-
greater installed on your machine. After doing this, you must also install the
19
+
Before you can start working on the Firebase JS SDK, you need to have Node.js 6.0 or
20
+
greater installed on your machine. After doing this, you must also install the
21
21
dependencies for this package.
22
22
23
23
To download Node.js visit https://nodejs.org/en/download/.
@@ -58,8 +58,8 @@ gulp --tasks
58
58
59
59
## Testing the SDK
60
60
61
-
To run all tests for the SDK you must first supply a firebase project config for
62
-
your tests. This is done by creating a file called `project.json` and at the
61
+
To run all tests for the SDK you must first supply a firebase project config for
62
+
your tests. This is done by creating a file called `project.json` and at the
63
63
following path:
64
64
65
65
```
@@ -69,15 +69,50 @@ tests/config/project.json
69
69
This file should contain a JSON object with your app information (i.e. the same
70
70
information you would pass to `firebase.initializeApp`).
71
71
72
-
After you have done this, simply run: `npm test` at the root of this package.
72
+
### Project Config
73
73
74
-
There are several types of available tests:
74
+
The project supplied in your `project.json` needs to be properly configured to
75
+
succesfully run the tests.
75
76
76
-
- Unit Tests (`gulp test:unit`)
77
-
- Integration Tests (`gulp test:integration`)
77
+
#### Database Rules
78
78
79
-
_NOTE: You can execute each of these tasks on their own (e.g. you can run
80
-
`gulp test:unit` to run exclusively the smoke tests from your CLI)_
79
+
_i.e._
80
+
81
+
```json
82
+
{
83
+
"rules": {
84
+
".read": "true",
85
+
".write": "true"
86
+
}
87
+
}
88
+
```
89
+
90
+
#### Authentiaction Support
91
+
92
+
Enable the `Anonymous` sign-in provider.
93
+
94
+
### Running the tests
95
+
96
+
After you have the `project.json` and have properly configured the project,
97
+
simply run: `npm test` at the root of this package.
98
+
99
+
You can also run the tests by calling `gulp test` if you have gulp installed.
100
+
101
+
You can decrease the testing scope by providing the optional `suite`/`env` arguments to `npm/gulp test`.
102
+
103
+
_e.g._
104
+
105
+
```bash
106
+
$ gulp test --suite=firestore --env=node
107
+
```
108
+
109
+
Any directory path in the tests directory serves as a valid value for the `--suite` flag.
110
+
111
+
Valid values for the `--env` flag are `node`/`browser`.
112
+
113
+
### Integration Tests
114
+
115
+
These tests are functionally different enough from the normal test suite that they have their own README.md. Please view it [here](./integration/README.md):
81
116
82
117
## Building the SDK
83
118
@@ -117,7 +152,7 @@ These files are processed in the following flow:
117
152
1. Prebuilt browser binaries are ready to consume individually in the browser
118
153
however we need to wrap them in a CJS module wrapper for node/webpack/browserify
119
154
consumption.
120
-
1. The Firebase App binary is generated (from TS) and concatenated with the
155
+
1. The Firebase App binary is generated (from TS) and concatenated with the
121
156
browser binaries of each individual module to create `firebase.js`.
0 commit comments