---
title: "Discussion on \"Mocking and Testing Firestore Operations in Flutter Unit Tests | Part 1 (Documents and Collections)\" | Hashnode"
description: "Discussion on \"Mocking and Testing Firestore Operations in Flutter Unit Tests | Part 1 (Documents and Collections)\". Introduction\nThis article examines Firestore operations with respect to Documents and Collections and demonstrates how to mock and test them.\nThe article was created using Flutter Channel stable, 2.8."
url: "https://hashnode.com/posts/mocking-firestore-flutter/620afa74dcdf3321c2e032c0"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Mocking and Testing Firestore Operations in Flutter Unit Tests | Part 1 (Documents and Collections)](https://blog.victoreronmosele.com/mocking-firestore-flutter?utm_source=hashnode&utm_medium=feed)

Introduction This article examines Firestore operations with respect to Documents and Collections and demonstrates how to mock and test them. The article was created using Flutter Channel stable, 2.8.

Feb 15, 2022 · 16 min read · blog.victoreronmosele.com  
Updated Oct 13  
Read the article

-   [#firebase](https://hashnode.com/tag/firebase)
-   [#flutter](https://hashnode.com/tag/flutter)
-   [#testing](https://hashnode.com/tag/testing)
-   [#unit-testing](https://hashnode.com/tag/unit-testing)
-   [#dart](https://hashnode.com/tag/dart)

## Written by

[Victor Eronmosele](https://hashnode.com/@victoreronmosele)

@victoreronmosele · Lagos, Nigeria

  
[View profile](https://hashnode.com/@victoreronmosele)

Software Engineer.

A highly motivated software engineer especially experienced as a mobile team lead working with diverse teams from all over the globe. Both as a team player and a mentor, he enjoys building secure, well-tested and visually appealing applications. Being ambitious and hardworking, he loves writing technical articles and spends his free time answering questions on StackOverflow as well as working on open-source projects.

## Responses 1

Comments are turned off for this post.

[Boris Kayi](https://hashnode.com/@silverhairs)

[Jan 27, 2023](https://hashnode.com/posts/mocking-firestore-flutter/620afa74dcdf3321c2e032c0/comment/63d3c761e56ca315fdf8004b)

Isn't fake\_cloud\_firestore supposed to be in `dev_dependencies`?

[Victor Eronmosele](https://hashnode.com/@victoreronmosele)

[Jan 27, 2023](https://hashnode.com/posts/mocking-firestore-flutter/620afa74dcdf3321c2e032c0/comment/63d3c761e56ca315fdf8004b#reply-63d3c9c4e56ca315fdf8008c)

You're right. I'll update the article.

[Boris Kayi](https://hashnode.com/@silverhairs)

[Jan 27, 2023](https://hashnode.com/posts/mocking-firestore-flutter/620afa74dcdf3321c2e032c0/comment/63d3c761e56ca315fdf8004b#reply-63d3ca50d9df8015cdfac738)

[Victor Eronmosele](https://hashnode.com/@victoreronmosele) Great content by the way 💪🏿

[Victor Eronmosele](https://hashnode.com/@victoreronmosele)

[Jan 27, 2023](https://hashnode.com/posts/mocking-firestore-flutter/620afa74dcdf3321c2e032c0/comment/63d3c761e56ca315fdf8004b#reply-63d3e012e56ca315fdf80485)

[Boris Kayi](https://hashnode.com/@silverhairs) Thank you!

I've updated the article and the demo code now.

Thanks for reading!
