angular / angular/angularfire

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

オープン
#3,050 コメント 4 件 リアクション 9 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
7.8k
フォーク
2.2k
平均マージ
22時間 28分
マージ済み PR(30日)
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 のテスト設定から始め、Firestore、Auth、Analytics のメソッドをモックしながら、報告されたユニットテストのエラーを再現します。Angular 12、Firebase 9、AngularFire 7 でこれらの AngularFire メソッドをモックするための動作するガイダンスを文書化できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, firebase, typescript
領域
documentation, testing
issue の種類
ドキュメント
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。