angular / angular/angularfire

[docs] Mocking of angularfire methods with angularfire 7 during tests

未關閉
#3,050 4 則留言 9 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
7.8k
分支
2.2k
平均合併
22 小時 28 分鐘
30 天內合併 PR
6

描述

### Version info

**Angular:** 12

**Firebase:** 9

**AngularFire:** 7

### How to reproduce these conditions

How to mock firebase operator during tests suits ?
How to write unit tests with mocks of firestore/auth/analytics methods ?

### Expected behavior

With Angularfire 6, I was able to mock angularfire methods like doc, collection and other methods to write my unit tests.
I would like to be able to mock it.

### Actual behavior

I am getting the error during my unit tests :
Error: Either AngularFireModule has not been provided in your AppModule (this can be done manually or implictly using provideFirebaseApp) or you're calling an AngularFire method outside of an NgModule (which is not supported).

貢獻指南

開啟貢獻指南

研究方向

從圍繞 AngularFireModule 和 provideFirebaseApp 的 AngularFire 7 測試設定開始,接著在 mock Firestore、Auth 和 Analytics 方法時重現回報的單元測試錯誤。完成的標準是記錄一份在 Angular 12、Firebase 9 和 AngularFire 7 下 mock 這些 AngularFire 方法的可行指南。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
angular, firebase, typescript
領域
documentation, testing
Issue 類型
文件
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。