Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

SchematicTestRunner.callRule does not use the logger by default #1016

Closed
@FrozenPandaz

Description

@FrozenPandaz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions