Collection of Ionic Mocks for Use in Every Project

オープン
#21 コメント 7 件 リアクション 4 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
typescript
領域
testing

調査の方向性

まず、参照されている Clicker src/mocks.ts ファイル、リンク先の gist、および7件のコメントからなる議論を確認してください。Issue では、どの Ionic モックを含めるのか、それらをどこに配置するのか、どのように検証するのかが定義されていないため、実装前にスコープと受け入れ基準について合意する必要があります。

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

説明

EDIT: I just realized that the main place I've grabbed Ionic mock from was the Clicker project. mocks.ts. Thanks to @lathonez for making this file available.

I created this issue to begin a discussion around mock objects in Ionic (and I'm not sure where else to have this discussion).

I've been doing a lot of unit testing lately for an Ionic 2 application. One of the things I've found to be very helpful is that there appear to be many mock objects available out there for use in Ionic unit testing. I've put together a few objects that I've needed in a current project into one file so that I can reference them. Take a look.

FYI:

  1. While I have made adjustments to this code, it is not mine. I've found these objects sprinkled over Stack Overflow and else where.
  2. These mocks are working for me, but Your Mileage May Vary.

Here's my issue. For this project, having reliable Ionic mocks is important. We should be unit testing our applications, not the Ionic Framework. There is no reason for each of us to be building their own set of Ionic mocks. As a community, we should be able to assemble these mocks.

Shouldn't we be able to provide mocks for as many of the Ionic pieces that may be needed?

Shouldn't we be able to provide best practices as to where to place these mocks and how to use them?

Re: Best practices: Currently, I have three files in my project:

  • src/testing/mock-ionic.ts: Ionic mocks
  • src/testing/mock-app.ts: mocks of object created in my project
  • src/testing/mock-data.ts: mock data that I can use with my mock services

This is how I've organized my current project. Again, YMMV.

Let the discussion begin.

主要言語
TypeScript
スター
370
フォーク
144
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ionic-team/ionic-unit-testing-example のほかの issue

ionic-team/ionic-unit-testing-example の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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