Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Example/Documentation on clearFirestoreData function #913

joshpetit started this conversation in Ideas
Discussion options

Hey there! Thanks for creating these samples, they're very helpful in creating up to date Firebase code.

I've been using the firebase-functions-test library and trying to use the FeaturesList.firestore.clearFirestoreData(string | { projectId: string}) function and can't seem to be get it to do what I believe it's trying to do (clear all the documents within the emulated firestore). I've tried running it in an afterEach within my test file like this:

afterEach(async () => {
 await ft.firestore.clearFirestoreData(
 {projectId: process.env.GCLOUD_PROJECT ?? ""}
 );
});

But that doesn't seem to do anything. I'm under the assumption that I may be unclear on what this function does. I'm creating tests within the firebase emulator so I'm not usre if this function works within the emulator (it states that it only works in offline mode).

Some example usages or an example of how to clear firestore data while testing an emulator would be awesome! Thank you.

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /