firebase / firebase/quickstart-testing

Example for asserting `HttpsError` thrown by cloud function

Open
#182 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
368
Forks
125
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.