Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

125
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda