A "Testing with Material Components" guide to demonstrate including core theme in test suite
- Lenguaje dominante
- TypeScript
- Estrellas
- 25k
- Forks
- 6.8k
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 91
Descripción
#### 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' }
],
```
Guía de contribución
Línea de trabajo
Lee la guía Getting Started y el karma.conf.js existente; después, compara la configuración de pruebas con la configuración de karma de Material mencionada y los pasos para crear una aplicación CLI nueva. Ejecuta las pruebas unitarias después de añadir md-card y verifica que la advertencia de core-theme haya desaparecido, dejando que la guía documente la configuración de pruebas necesaria.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- angular, typescript
- Área
- documentation, testing
- Tipo de issue
- Documentación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100