Skip to content

Commit

Permalink
Add Pub/Sub support + HTTPS testing (#925)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
inlined authored Aug 2, 2021
1 parent 0083fc7 commit 3d70007
Show file tree
Hide file tree
Showing 11 changed files with 754 additions and 24 deletions.
17 changes: 14 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,36 @@
"./lib/logger": "./lib/logger/index.js",
"./lib/logger/compat": "./lib/logger/compat.js",
"./v2": "./lib/v2/index.js",
"./v2/core": "./lib/v2/core.js",
"./v2/options": "./lib/v2/options.js",
"./v2/https": "./lib/v2/providers/https.js"
"./v2/https": "./lib/v2/providers/https.js",
"./v2/pubsub": "./lib/v2/providers/pubsub.js"
},
"typesVersions": {
"*": {
"logger/*": [
"lib/logger/*"
"logger": [
"lib/logger"
],
"logger/compat": [
"lib/logger/compat"
],
"v1": [
"lib/v1"
],
"v2": [
"lib/v2"
],
"v2/base": [
"lib/v2/base"
],
"v2/options": [
"lib/v2/options"
],
"v2/https": [
"lib/v2/providers/https"
],
"v2/pubsub": [
"lib/v2/providers/pubsub"
]
}
},
Expand Down
2 changes: 0 additions & 2 deletions spec/v1/providers/https.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ import {
MockRequest,
} from '../../fixtures/mockrequest';

// TODO(inlined) dedup this between v1, common, etc.

/**
* RunHandlerResult contains the data from an express.Response.
*/
Expand Down
35 changes: 35 additions & 0 deletions spec/v2/providers/helpers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import * as options from '../../../src/v2/options';

export const FULL_OPTIONS: options.GlobalOptions = {
region: 'us-west1',
memory: '512MB',
timeoutSeconds: 60,
minInstances: 1,
maxInstances: 3,
concurrency: 20,
vpcConnector: 'aConnector',
vpcConnectorEgressSettings: 'ALL_TRAFFIC',
serviceAccount: 'root@',
ingressSettings: 'ALLOW_ALL',
labels: {
hello: 'world',
},
};

export const FULL_TRIGGER = {
apiVersion: 2,
platform: 'gcfv2',
regions: ['us-west1'],
availableMemoryMb: 512,
timeout: '60s',
minInstances: 1,
maxInstances: 3,
concurrency: 20,
vpcConnector: 'aConnector',
vpcConnectorEgressSettings: 'ALL_TRAFFIC',
serviceAccountEmail: '[email protected]',
ingressSettings: 'ALLOW_ALL',
labels: {
hello: 'world',
},
};
Loading

0 comments on commit 3d70007

Please sign in to comment.