SchematicTestRunner.callRule does not use the logger by default
- Linguagem predominante
- TypeScript
- Estrelas
- 27k
- Forks
- 11.8k
- Merge médio
- 14h 23min
- PRs com merge (30d)
- 162
Descrição
_From @FrozenPandaz on June 6, 2018 3:12_
### Bug Report or Feature Request (mark with an `x`)
```
- [x] bug report -> please search issues before submitting
- [ ] feature request
```
### Area
```
- [x] devkit
- [ ] schematics
```
### Versions
Ubuntu
### Repro steps
```ts
const schematicRunner = new SchematicTestRunner(
collectionName,
pathToCollectionJson
);
const spy = spyOn(schematicRunner.logger, 'info');
schematicRunner
.callRule((host: Tree, context: SchematicContext) => {
context.logger.info('Hello world!');
, Tree.empty())
.subscribe(result => {
expect(spy).toHaveBeenCalledWith('Hello world!');
});
```
### The log given by the failure
Expected spy to have been called 'Hello world!' but was not called.
### Desired functionality
The SchematicTestRunner logger should be used by default and the test should pass
### Mention any other details that might be useful
Any unit tests which test rules
_Copied from original issue: angular/devkit#1016_
Guia de contribuição
Direção de pesquisa
Comece em SchematicTestRunner.callRule e acompanhe como o logger dele é fornecido ao contexto da regra. Revise os testes unitários das regras e reproduza o exemplo mostrado; em seguida, verifique se o logger do runner recebe “Hello world!” por padrão.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- typescript
- Domínio
- testing
- Tipo de issue
- Bug
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 35/100