angular / angular/components

A "Testing with Material Components" guide to demonstrate including core theme in test suite

オープン
#4,056 コメント 30 件 リアクション 41 件 担当者 0 名 GitHub で見る
area: material.angular.io docs feature help wanted P3
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

#### Bug, feature request, or proposal:
Bug or missing docs

#### What is the expected behavior?
Tests shouldn't log warnings after following the Getting Started guide on a fresh cli generated app.

#### Current behavior / steps to reproduce

1. Fresh cli app
2. Follow the getting started guide
3. Add an `md-card` component to AppComponent
4. Run unit tests
5. Resulting warning:

```
WARN: 'Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming'
Chrome 57.0.2987 (Mac OS X 10.12.4): Executed 0 of 3 SUCCESS (0 secs / 0 secs)
Chrome 57.0.2987 (Mac OS X 10.12.4): Executed 3 of 3 SUCCESS (0.226 secs / 0.199 secs)
```

#### Is there anything else we should know?
Modifying `karma.conf.js` to include a theme silenced the warning. This approach was borrowed from [Material's karma config](https://github.com/angular/material2/blob/master/test/karma.conf.js#L35-L36):

```
files: [
{ pattern: './src/test.ts', watched: false },
{ pattern: './node_modules/@angular/material/prebuilt-themes/indigo-pink.css' }
],
```

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

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

調査の方向性

Getting Started ガイドと既存の karma.conf.js を読み、テストのセットアップを参照されている Material karma 設定および新しい CLI アプリの手順と比較します。md-card を追加した後に単体テストを実行し、core-theme の警告がなくなったことを確認します。また、ガイドには必要なテストのセットアップを記載します。

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

評価

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

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

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