diff --git a/firebase-functions/src/androidTest/backend/functions/index.js b/firebase-functions/src/androidTest/backend/functions/index.js index 631945dfa75..b55625fbd32 100644 --- a/firebase-functions/src/androidTest/backend/functions/index.js +++ b/firebase-functions/src/androidTest/backend/functions/index.js @@ -12,32 +12,32 @@ // See the License for the specific language governing permissions and // limitations under the License. -const assert = require("assert"); -const functions = require("firebase-functions"); +const assert = require('assert'); +const functions = require('firebase-functions'); exports.dataTest = functions.https.onRequest((request, response) => { assert.deepEqual(request.body, { data: { - "bool": true, - "int": 2, - "long": { - "value": "3", - "@type": "type.googleapis.com/google.protobuf.Int64Value", + bool: true, + int: 2, + long: { + value: '3', + '@type': 'type.googleapis.com/google.protobuf.Int64Value', }, - "string": "four", - "array": [5, 6], - "null": null, - }, + string: 'four', + array: [5, 6], + 'null': null, + } }); response.send({ data: { - message: "stub response", + message: 'stub response', code: 42, long: { - "value": "420", - "@type": "type.googleapis.com/google.protobuf.Int64Value", + value: '420', + '@type': 'type.googleapis.com/google.protobuf.Int64Value', }, - }, + } }); }); @@ -47,29 +47,28 @@ exports.scalarTest = functions.https.onRequest((request, response) => { }); exports.tokenTest = functions.https.onRequest((request, response) => { - assert.equal(request.get("Authorization"), "Bearer token"); + assert.equal(request.get('Authorization'), 'Bearer token'); assert.deepEqual(request.body, {data: {}}); response.send({data: {}}); }); exports.instanceIdTest = functions.https.onRequest((request, response) => { - assert.equal(request.get("Firebase-Instance-ID-Token"), "iid"); + assert.equal(request.get('Firebase-Instance-ID-Token'), 'iid'); assert.deepEqual(request.body, {data: {}}); response.send({data: {}}); }); exports.appCheckTest = functions.https.onRequest((request, response) => { - assert.equal(request.get("X-Firebase-AppCheck"), "appCheck"); + assert.equal(request.get('X-Firebase-AppCheck'), 'appCheck'); assert.deepEqual(request.body, {data: {}}); response.send({data: {}}); }); -exports.appCheckLimitedUseTest = functions.https.onRequest( - (request, response) => { - assert.equal(request.get("X-Firebase-AppCheck"), "appCheck-limited-use"); - assert.deepEqual(request.body, {data: {}}); - response.send({data: {}}); - }); +exports.appCheckLimitedUseTest = functions.https.onRequest((request, response) => { + assert.equal(request.get('X-Firebase-AppCheck'), 'appCheck-limited-use'); + assert.deepEqual(request.body, {data: {}}); + response.send({data: {}}); +}); exports.nullTest = functions.https.onRequest((request, response) => { assert.deepEqual(request.body, {data: null}); @@ -83,15 +82,15 @@ exports.missingResultTest = functions.https.onRequest((request, response) => { exports.unhandledErrorTest = functions.https.onRequest((request, response) => { // Fail in a way that the client shouldn't see. - throw new Error("nope"); + throw 'nope'; }); exports.unknownErrorTest = functions.https.onRequest((request, response) => { // Send an http error with a body with an explicit code. response.status(400).send({ error: { - status: "THIS_IS_NOT_VALID", - message: "this should be ignored", + status: 'THIS_IS_NOT_VALID', + message: 'this should be ignored', }, }); }); @@ -100,14 +99,14 @@ exports.explicitErrorTest = functions.https.onRequest((request, response) => { // Send an http error with a body with an explicit code. response.status(400).send({ error: { - status: "OUT_OF_RANGE", - message: "explicit nope", + status: 'OUT_OF_RANGE', + message: 'explicit nope', details: { start: 10, end: 20, long: { - "value": "30", - "@type": "type.googleapis.com/google.protobuf.Int64Value", + value: '30', + '@type': 'type.googleapis.com/google.protobuf.Int64Value', }, }, },