Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

SchematicTestRunner.callRule does not use the logger by default

Open
#12,087 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
testing

Research direction

Start at SchematicTestRunner.callRule and trace how its logger is provided to the rule context. Review the unit tests for rules and reproduce the shown example, then verify that the runner's logger receives “Hello world!” by default.

Written by the indexing model from the issue text.

Description

area: @angular-devkit/schematics effort1: easy (hours) type: bug/fix

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

    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

Dominant language
TypeScript
Stars
27k
Forks
11.8k
Avg merge
17h 25m
Merged PRs (30d)
183

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from angular/angular-cli

All issues in angular/angular-cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.