
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
firebase-functions-test
Advanced tools
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.
wrap your Firebase Functions. You can invoke the Firebase Function's handler by invoking the wrap call.Eg.
import {myFirebaseFunction} from "../index"; // Your Firebase Functions
import firebaseFunctionsTest from "firebase-functions-test";
// Extracting `wrap` out of the lazy-loaded features
const {wrap} = firebaseFunctionsTest();
// `jest-ts` example
test('my unit test', () => {
const wrappedFirebaseFunction = wrap(myFirebaseFunction);
// Invoke the firebase function
wrappedFirebaseFunction();
// Invoke the firebase function with CloudEvent overrides
wrappedFirebaseFunction({data: {arbitrary: 'values'}});
});
Learn more about unit testing Cloud Functions here.
To contribute a change, check out the contributing guide.
© Google, 2018. Licensed under The MIT License.
Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple and fun. While it is not specific to Firebase, it can be used in conjunction with other libraries to test Firebase functions.
Jest is a delightful JavaScript Testing Framework with a focus on simplicity. It works with projects using Babel, TypeScript, Node.js, React, Angular, Vue.js, and Svelte. Jest can be used to test Firebase functions but requires additional setup for mocking Firebase services.
Sinon is a standalone test spies, stubs, and mocks for JavaScript. It works with any unit testing framework. While Sinon is not specific to Firebase, it is often used to mock Firebase services in tests.
FAQs
A testing companion to firebase-functions.
The npm package firebase-functions-test receives a total of 180,394 weekly downloads. As such, firebase-functions-test popularity was classified as popular.
We found that firebase-functions-test demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.