Skip to content

Commit d26a2c8

Browse files
committed
Merge branch 'master' of https://github.com/firebase/firebase-functions into launch.next
2 parents 77f905e + cf27ac6 commit d26a2c8

File tree

14 files changed

+450
-176
lines changed

14 files changed

+450
-176
lines changed

package-lock.json

Lines changed: 2 additions & 162 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "firebase-functions",
3-
"version": "3.23.0",
3+
"version": "3.24.0",
44
"description": "Firebase SDK for Cloud Functions",
55
"keywords": [
66
"firebase",
@@ -52,6 +52,7 @@
5252
"./v2/alerts/appDistribution": "./lib/v2/providers/alerts/appDistribution.js",
5353
"./v2/alerts/billing": "./lib/v2/providers/alerts/billing.js",
5454
"./v2/alerts/crashlytics": "./lib/v2/providers/alerts/crashlytics.js",
55+
"./v2/alerts/performance": "./lib/v2/providers/alerts/performance.js",
5556
"./v2/eventarc": "./lib/v2/providers/eventarc.js",
5657
"./v2/identity": "./lib/v2/providers/identity.js",
5758
"./v2/database": "./lib/v2/providers/database.js",
@@ -114,6 +115,9 @@
114115
"v2/alerts/crashlytics": [
115116
"lib/v2/providers/alerts/crashlytics"
116117
],
118+
"v2/alerts/performance": [
119+
"lib/v2/providers/alerts/performance"
120+
],
117121
"v2/base": [
118122
"lib/v2/base"
119123
],

spec/runtime/manifest.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { stackToWire, ManifestStack } from "../../src/runtime/manifest";
21
import { expect } from "chai";
2+
import { stackToWire, ManifestStack } from "../../src/runtime/manifest";
33
import * as params from "../../src/params";
44

55
describe("stackToWire", () => {

spec/v2/providers/alerts/alerts.spec.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { expect } from "chai";
2+
import { CloudEvent } from "../../../../src/v2";
23
import * as options from "../../../../src/v2/options";
34
import * as alerts from "../../../../src/v2/providers/alerts";
45
import { FULL_ENDPOINT, FULL_OPTIONS } from "../fixtures";
@@ -166,4 +167,41 @@ describe("alerts", () => {
166167
expect(appId).to.be.equal(myOpts.appId);
167168
});
168169
});
170+
171+
describe("convertAlertAndApp", () => {
172+
const event: CloudEvent<string> = {
173+
specversion: "1.0",
174+
id: "id",
175+
source: "source",
176+
type: "type",
177+
time: "now",
178+
data: "data",
179+
};
180+
181+
it("should leave event unchanged if alerttype & appid are missing", () => {
182+
const raw = { ...event };
183+
184+
const converted = alerts.convertAlertAndApp(raw);
185+
186+
expect(raw).to.deep.eq(converted);
187+
});
188+
189+
it("should convert alerttype & appid when present", () => {
190+
const raw = {
191+
...event,
192+
alerttype: "my-alert",
193+
appid: "my-app",
194+
};
195+
196+
const converted = alerts.convertAlertAndApp(raw);
197+
198+
expect(converted).to.deep.eq({
199+
...event,
200+
alerttype: "my-alert",
201+
appid: "my-app",
202+
alertType: "my-alert",
203+
appId: "my-app",
204+
});
205+
});
206+
});
169207
});

0 commit comments

Comments
 (0)