小编Ben*_*Ben的帖子

flutter 中的单元测试 firebase 抛出异常“未创建 Firebase 应用程序‘[DEFAULT]’ - 调用 Firebase.initializeApp()”

I need to unit test an application that uses firebase. My unit tests always says "Unhandled Exception: [core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp()". I absolutely understand why this problem occurs. But I still want to unit test my methods without really starting firebase. Even Mocking the firebase stuff did not help. Hopefully you can help me out? What am I misunderstanding?

For Example I rewrote the code from this tutorial: https://www.youtube.com/watch?v=4d6hEaUVvuU

This is my test …

testing unit-testing mocking firebase flutter

6
推荐指数
0
解决办法
1250
查看次数

标签 统计

firebase ×1

flutter ×1

mocking ×1

testing ×1

unit-testing ×1