firebase / firebase/quickstart-testing

Example for asserting `HttpsError` thrown by cloud function

Aperta
#182 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
368
Fork
125
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

It would be really nice to have an example how to assert `HttpsError`, which are thrown by a cloud function.
```ts
exports.testCallable = functions.https.onCall((data, context) => {
console.log('testCallable');
return new functions.https.HttpsError('ok', 'this is an error');
})
```

How to write a test, that a `HttpsError` with the message `this is an error` was thrown?

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.