Skip to content

Commit 3d70007

Browse files
authored
Add Pub/Sub support + HTTPS testing (#925)
Add Pub/Sub support + HTTPS testing While adding Pub/Sub support I noticed that there were now v2/ tests. Added those tests + fixes that they uncovered. Also fixed issue where 'firebase-functions/logger' wasn't working as an import in my test project.
1 parent 0083fc7 commit 3d70007

File tree

11 files changed

+754
-24
lines changed

11 files changed

+754
-24
lines changed

package.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,36 @@
3131
"./lib/logger": "./lib/logger/index.js",
3232
"./lib/logger/compat": "./lib/logger/compat.js",
3333
"./v2": "./lib/v2/index.js",
34+
"./v2/core": "./lib/v2/core.js",
3435
"./v2/options": "./lib/v2/options.js",
35-
"./v2/https": "./lib/v2/providers/https.js"
36+
"./v2/https": "./lib/v2/providers/https.js",
37+
"./v2/pubsub": "./lib/v2/providers/pubsub.js"
3638
},
3739
"typesVersions": {
3840
"*": {
39-
"logger/*": [
40-
"lib/logger/*"
41+
"logger": [
42+
"lib/logger"
43+
],
44+
"logger/compat": [
45+
"lib/logger/compat"
4146
],
4247
"v1": [
4348
"lib/v1"
4449
],
4550
"v2": [
4651
"lib/v2"
4752
],
53+
"v2/base": [
54+
"lib/v2/base"
55+
],
4856
"v2/options": [
4957
"lib/v2/options"
5058
],
5159
"v2/https": [
5260
"lib/v2/providers/https"
61+
],
62+
"v2/pubsub": [
63+
"lib/v2/providers/pubsub"
5364
]
5465
}
5566
},

spec/v1/providers/https.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ import {
3030
MockRequest,
3131
} from '../../fixtures/mockrequest';
3232

33-
// TODO(inlined) dedup this between v1, common, etc.
34-
3533
/**
3634
* RunHandlerResult contains the data from an express.Response.
3735
*/

spec/v2/providers/helpers.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import * as options from '../../../src/v2/options';
2+
3+
export const FULL_OPTIONS: options.GlobalOptions = {
4+
region: 'us-west1',
5+
memory: '512MB',
6+
timeoutSeconds: 60,
7+
minInstances: 1,
8+
maxInstances: 3,
9+
concurrency: 20,
10+
vpcConnector: 'aConnector',
11+
vpcConnectorEgressSettings: 'ALL_TRAFFIC',
12+
serviceAccount: 'root@',
13+
ingressSettings: 'ALLOW_ALL',
14+
labels: {
15+
hello: 'world',
16+
},
17+
};
18+
19+
export const FULL_TRIGGER = {
20+
apiVersion: 2,
21+
platform: 'gcfv2',
22+
regions: ['us-west1'],
23+
availableMemoryMb: 512,
24+
timeout: '60s',
25+
minInstances: 1,
26+
maxInstances: 3,
27+
concurrency: 20,
28+
vpcConnector: 'aConnector',
29+
vpcConnectorEgressSettings: 'ALL_TRAFFIC',
30+
serviceAccountEmail: 'root@aProject.iam.gserviceaccount.com',
31+
ingressSettings: 'ALLOW_ALL',
32+
labels: {
33+
hello: 'world',
34+
},
35+
};

0 commit comments

Comments
 (0)