Installations
npm install firebase-functions-test
Score
58.4
Supply Chain
58.4
Quality
74.8
Maintenance
100
Vulnerability
91.3
License
Developer
firebase
Developer Guide
Module System
CommonJS
Min. Node Version
>=14.0.0
Typescript Support
No
Node Version
14.19.1
NPM Version
8.9.0
Statistics
236 Stars
177 Commits
54 Forks
56 Watching
60 Branches
63 Contributors
Updated on 26 Nov 2024
Languages
TypeScript (97.6%)
Shell (1.66%)
JavaScript (0.56%)
Dockerfile (0.19%)
Total Downloads
Cumulative downloads
Total Downloads
36,993,292
Last day
6.6%
37,445
Compared to previous day
Last week
2.6%
197,615
Compared to previous week
Last month
15.7%
758,892
Compared to previous month
Last year
-1.1%
8,239,261
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
3
Peer Dependencies
3
Firebase Test SDK for Cloud Functions
The firebase-functions-test
is unit testing library for Cloud Functions for Firebase. It is a companion to firebase-functions.
NOTE: This library can only be used with firebase-functions
v3.20.1 or above.
Usage
- Write some Firebase Functions
- With your testing framework of choice, write a unit-test that imports your Firebase Functions.
wrap
your Firebase Functions. You can invoke the Firebase Function's handler by invoking thewrap
call.
Eg.
1import {myFirebaseFunction} from "../index"; // Your Firebase Functions 2import firebaseFunctionsTest from "firebase-functions-test"; 3 4// Extracting `wrap` out of the lazy-loaded features 5const {wrap} = firebaseFunctionsTest(); 6 7// `jest-ts` example 8test('my unit test', () => { 9 const wrappedFirebaseFunction = wrap(myFirebaseFunction); 10 11 // Invoke the firebase function 12 wrappedFirebaseFunction(); 13 14 // Invoke the firebase function with CloudEvent overrides 15 wrappedFirebaseFunction({data: {arbitrary: 'values'}}); 16});
Examples
- Unit Testing Gen-1 Cloud Functions using Mocha
- Unit Testing Gen-2 Cloud Functions using Mocha
- Unit Testing Gen-2 Cloud Functions using Jest
- Unit Testing Gen-2 Cloud Functions using Jest-Ts
Learn more
Learn more about unit testing Cloud Functions here.
Contributing
To contribute a change, check out the contributing guide.
License
© Google, 2018. Licensed under The MIT License.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
security policy file detected
Details
- Info: security policy file detected: github.com/firebase/.github/SECURITY.md:1
- Info: Found linked content: github.com/firebase/.github/SECURITY.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/firebase/.github/SECURITY.md:1
- Info: Found text in security policy: github.com/firebase/.github/SECURITY.md:1
Reason
Found 13/29 approved changesets -- score normalized to 4
Reason
SAST tool is not run on all commits -- score normalized to 3
Details
- Warn: 6 commits out of 18 are checked with a SAST tool
Reason
dependency not pinned by hash detected -- score normalized to 1
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/firebase/firebase-functions-test/test.yaml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/firebase/firebase-functions-test/test.yaml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/firebase/firebase-functions-test/test.yaml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/firebase/firebase-functions-test/test.yaml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/firebase/firebase-functions-test/test.yaml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/firebase/firebase-functions-test/test.yaml/master?enable=pin
- Warn: containerImage not pinned by hash: scripts/publish-container/Dockerfile:1: pin your Docker image by updating node:14 to node:14@sha256:a158d3b9b4e3fa813fa6c8c590b8f0a860e015ad4e59bbce5744d2f6fd8461aa
- Warn: npmCommand not pinned by hash: scripts/publish-container/Dockerfile:8
- Warn: npmCommand not pinned by hash: scripts/publish.sh:132
- Warn: npmCommand not pinned by hash: .github/workflows/test.yaml:54
- Info: 0 out of 6 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 containerImage dependencies pinned
- Info: 2 out of 5 npmCommand dependencies pinned
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/test.yaml:1
- Info: no jobLevel write permissions found
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
61 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-pp75-xfpw-37g9
- Warn: Project is vulnerable to: GHSA-7v5v-9h63-cj86
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25
- Warn: Project is vulnerable to: GHSA-7p89-p6hx-q4fw
- Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-257v-vj4p-3w2h
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h
- Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx
- Warn: Project is vulnerable to: GHSA-rcm2-22f3-pqv3
- Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm
- Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5
- Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97
- Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j
- Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37
- Warn: Project is vulnerable to: GHSA-hhhv-q57g-882q
- Warn: Project is vulnerable to: GHSA-wgfq-7857-4jcc
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-8cf7-32gw-wr33
- Warn: Project is vulnerable to: GHSA-hjrf-2m68-5959
- Warn: Project is vulnerable to: GHSA-qwph-4952-7xr6
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj
- Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-92xj-mqp7-vmcj
- Warn: Project is vulnerable to: GHSA-wxgw-qj99-44c2
- Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5
- Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp
- Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq
- Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr
- Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765
- Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g
- Warn: Project is vulnerable to: GHSA-px4h-xg32-q955
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg
- Warn: Project is vulnerable to: GHSA-g954-5hwp-pp24
- Warn: Project is vulnerable to: GHSA-h755-8qp9-cq85
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9
- Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw
- Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc
- Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh
- Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
Score
3.8
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More