[FR] firebase-functions-test multiple snapshots in wrapped functions
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- firebase, typescript
Research direction
Start with the wrapped function API shown in the example and the makeDocumentSnapshot calls, then trace how the current wrapper accepts a snapshot. Check how background functions handle event data and determine the expected shape for multiple snapshots. Done means a wrapped function can receive snapshots from multiple collections, with tests covering the demonstrated array input.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
I'm using firebase-functions-test package to locally mock firestore data and test non-http functions. However, on of my functions works with data in multiple collections, which based on the docs and articles I've found doesn't seem to be supported.
Describe the solution you'd like
When calling my wrapped function(s), I'd like to be able to pass in multiple document snapshots.
Describe alternatives you've considered
If I am to continue using the firebase-functions-test package, I could consider creating a chain of background functions that each work with documents from a single collection. I haven't seen anything saying whether that's a good approach so for all I know that might actually be the preferred way to do this, though it feels weird to me.
Another option would be to not use firebase-functions-test package and instead run my tests against the emulator. I had been doing this before but wanted to move away from that.
Additional context
Here is a code sample of what I'm looking to do, not sure that it's valid Typescript but hopefully it demonstrate the goal.
const snap1 = test.firestore.makeDocumentSnapshot({
...
}, "users/1");
const snap2 = test.firestore.makeDocumentSnapshot({
...
}, "users/2");
await wrapped([snap1, snap2], { // <-- Notice the array of snapshots
..
});
- Dominant language
- TypeScript
- Stars
- 248
- Forks
- 63
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from firebase/firebase-functions-test
-
type: enhancement
Difficulty 3/5 1-2 days Newbie friendliness 58/100
firebase/firebase-functions-test#333 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
firebase/firebase-functions-test#327 · 2 comments · 16 reactions ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
firebase/firebase-functions-test#325 · 2 comments · 3 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
firebase/firebase-functions-test#310 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
firebase/firebase-functions-test#281 · 2 comments ·
All issues in firebase/firebase-functions-test
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
fullcalendar/fullcalendar#8106 ·