Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

123
Views
Where does the actual cloud function unit test { firebase-functions-test } run when ran using a test framework?

I would like to know, where does the cloud function unit test run, when ran using a test runner (say mocha or jest)?

npm run test

FYI, I am not running inside any of the firebase emulators

When I run using mocha, it is able to create write to the firestore (I am sure jest will do the same), but I can't see the function names in the logs, which means, the function ran locally inside test runner and wrote to firestore db.

Does that mean the https callable cloud functions can't be called from firebase backend using test runner? I have tried both ways: that is directly calling the functions and wrapping using wrap() method provided by firebase-functions-test library. both times the function ran locally.

direct call:

.....
.....
.....
funcName.run({foo:"bar"}, { auth: { uid: "ABC" } });
.....
.....
.....

using wrap:

.....
.....
.....
const projectConfig = {
  projectId: 'my-project',
  databaseURL: 'https://my-project.firebaseio.com'
};
const test = require('firebase-functions-test')(projectConfig, './service-account-key.json');
wrapped = test.wrap(funcName);
expect(
        wrapped(
            { foo: "bar" },
            { auth: { uid: "ABC" } }
        )
).to.contain('foobar');
.....
.....
.....
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Does that mean the https callable cloud functions can't be called from firebase backend using test runner?

The firebase-functions-test framework is designed to run everything locally, so you get predictable and reliable execution without a dependency on some external network connection. It will not run anything remotely.

If you want to run a callable function that's been deployed somewhere, you can write code to invoke it directly using any normal HTTP client library, and onCall protocol information provided in the documentation.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!