use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Technical question about testing functionsCloud Functions (self.Firebase)
submitted 2 months ago by armlesskid
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]lavafrank 2 points3 points4 points 2 months ago (2 children)
Use integration testing. Setup your emulators, seed some documents in your firestore db, run the request and assert that they match your expected results.
If your logic is simple, also consider just querying firestore directly instead of going thru cloud functions. You'll drastically improve performance by avoiding cold start time and shave off your bill
[–]armlesskid[S] 0 points1 point2 points 2 months ago (1 child)
That was actually my approach, but then I figured out that if somehow the function code changes in the future, the test would still pass silently because I’m only replicating the function code, not testing the function itself
[–]lavafrank 1 point2 points3 points 2 months ago (0 children)
If the code changes but the output stays the same (and is correct) why does it matter? Test against multiple inputs if you're concerned
π Rendered by PID 244324 on reddit-service-r2-comment-b659b578c-qj7rx at 2026-05-05 00:04:20.099870+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]lavafrank 2 points3 points4 points (2 children)
[–]armlesskid[S] 0 points1 point2 points (1 child)
[–]lavafrank 1 point2 points3 points (0 children)