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: quickstarts/uppercase/README.md
+14-2Lines changed: 14 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,9 @@ This sample app does two things:
9
9
- Create messages in the Firebase Realtime Database using a simple HTTPS request which is handled by an HTTPS Firebase Function. Writing to the Realtime Database is done using the Firebase Admin SDK.
10
10
- When a message gets added in the Realtime Database, a Firebase Function triggers and automatically makes these messages all uppercase.
11
11
12
-
## Deploy and test
12
+
## Deploy and try out
13
13
14
-
To deploy and test the sample:
14
+
To deploy and try out the sample:
15
15
16
16
- Create a Firebase project on the [Firebase Console](https://console.firebase.google.com)
17
17
- Install the required dependencies by running `npm install` in the `functions` directory
@@ -20,8 +20,20 @@ To deploy and test the sample:
20
20
21
21
The function executes and redirects the browser to the Firebase console at the database location where the text string was stored. You should see your text value displayed in the console and uppercase.
22
22
23
+
## Run unit tests
23
24
25
+
The test folder has unit tests written with `firebase-functions-test`. There are 2 sets of tests: online and offline.
24
26
27
+
To run the offline tests: run `npm test` inside the functions folder.
28
+
29
+
To run the online tests:
30
+
- Replace the `projectConfig` variable in `test/test.online.js` with configuration values from your project.
31
+
- Download a service account key by following these instructions:
32
+
..* Open the Service Accounts pane of the Google Cloud Console.
33
+
..* Select the App Engine default service account, and use the options menu at right to select Create key.
34
+
..* When prompted, select JSON for the key type, and click Create.
35
+
- Save the file in the test folder, and name it `service-account-key.json`
36
+
- Run `npm run test-online` inside the functions folder.
0 commit comments