Skip to content

Commit 6d3012d

Browse files
Merge remote-tracking branch 'origin/stream-functions-api' into stream-functions-api
# Conflicts: # firebase-functions/src/androidTest/java/com/google/firebase/functions/StramTests.kt
2 parents 9e13ef7 + 535fb90 commit 6d3012d

File tree

2 files changed

+30
-31
lines changed

2 files changed

+30
-31
lines changed

firebase-functions/src/androidTest/backend/functions/index.js

+30-31
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,32 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
const assert = require("assert");
16-
const functions = require("firebase-functions");
15+
const assert = require('assert');
16+
const functions = require('firebase-functions');
1717

1818
exports.dataTest = functions.https.onRequest((request, response) => {
1919
assert.deepEqual(request.body, {
2020
data: {
21-
"bool": true,
22-
"int": 2,
23-
"long": {
24-
"value": "3",
25-
"@type": "type.googleapis.com/google.protobuf.Int64Value",
21+
bool: true,
22+
int: 2,
23+
long: {
24+
value: '3',
25+
'@type': 'type.googleapis.com/google.protobuf.Int64Value',
2626
},
27-
"string": "four",
28-
"array": [5, 6],
29-
"null": null,
30-
},
27+
string: 'four',
28+
array: [5, 6],
29+
'null': null,
30+
}
3131
});
3232
response.send({
3333
data: {
34-
message: "stub response",
34+
message: 'stub response',
3535
code: 42,
3636
long: {
37-
"value": "420",
38-
"@type": "type.googleapis.com/google.protobuf.Int64Value",
37+
value: '420',
38+
'@type': 'type.googleapis.com/google.protobuf.Int64Value',
3939
},
40-
},
40+
}
4141
});
4242
});
4343

@@ -47,29 +47,28 @@ exports.scalarTest = functions.https.onRequest((request, response) => {
4747
});
4848

4949
exports.tokenTest = functions.https.onRequest((request, response) => {
50-
assert.equal(request.get("Authorization"), "Bearer token");
50+
assert.equal(request.get('Authorization'), 'Bearer token');
5151
assert.deepEqual(request.body, {data: {}});
5252
response.send({data: {}});
5353
});
5454

5555
exports.instanceIdTest = functions.https.onRequest((request, response) => {
56-
assert.equal(request.get("Firebase-Instance-ID-Token"), "iid");
56+
assert.equal(request.get('Firebase-Instance-ID-Token'), 'iid');
5757
assert.deepEqual(request.body, {data: {}});
5858
response.send({data: {}});
5959
});
6060

6161
exports.appCheckTest = functions.https.onRequest((request, response) => {
62-
assert.equal(request.get("X-Firebase-AppCheck"), "appCheck");
62+
assert.equal(request.get('X-Firebase-AppCheck'), 'appCheck');
6363
assert.deepEqual(request.body, {data: {}});
6464
response.send({data: {}});
6565
});
6666

67-
exports.appCheckLimitedUseTest = functions.https.onRequest(
68-
(request, response) => {
69-
assert.equal(request.get("X-Firebase-AppCheck"), "appCheck-limited-use");
70-
assert.deepEqual(request.body, {data: {}});
71-
response.send({data: {}});
72-
});
67+
exports.appCheckLimitedUseTest = functions.https.onRequest((request, response) => {
68+
assert.equal(request.get('X-Firebase-AppCheck'), 'appCheck-limited-use');
69+
assert.deepEqual(request.body, {data: {}});
70+
response.send({data: {}});
71+
});
7372

7473
exports.nullTest = functions.https.onRequest((request, response) => {
7574
assert.deepEqual(request.body, {data: null});
@@ -83,15 +82,15 @@ exports.missingResultTest = functions.https.onRequest((request, response) => {
8382

8483
exports.unhandledErrorTest = functions.https.onRequest((request, response) => {
8584
// Fail in a way that the client shouldn't see.
86-
throw new Error("nope");
85+
throw 'nope';
8786
});
8887

8988
exports.unknownErrorTest = functions.https.onRequest((request, response) => {
9089
// Send an http error with a body with an explicit code.
9190
response.status(400).send({
9291
error: {
93-
status: "THIS_IS_NOT_VALID",
94-
message: "this should be ignored",
92+
status: 'THIS_IS_NOT_VALID',
93+
message: 'this should be ignored',
9594
},
9695
});
9796
});
@@ -100,14 +99,14 @@ exports.explicitErrorTest = functions.https.onRequest((request, response) => {
10099
// Send an http error with a body with an explicit code.
101100
response.status(400).send({
102101
error: {
103-
status: "OUT_OF_RANGE",
104-
message: "explicit nope",
102+
status: 'OUT_OF_RANGE',
103+
message: 'explicit nope',
105104
details: {
106105
start: 10,
107106
end: 20,
108107
long: {
109-
"value": "30",
110-
"@type": "type.googleapis.com/google.protobuf.Int64Value",
108+
value: '30',
109+
'@type': 'type.googleapis.com/google.protobuf.Int64Value',
111110
},
112111
},
113112
},

0 commit comments

Comments
 (0)