Skip to content

Running "Replace removed matcher aliases in Jest v30 with their corresponding matcher" migration removes all empty lines from .spec.ts file #34458

@Sergiu-Solomon

Description

@Sergiu-Solomon

Current Behavior

All the empty lines from all the *spec.ts file are removed.

Image

Expected Behavior

Only the matcher functions get replaced. No changes to other parts of the code.

GitHub Repo

No response

Steps to Reproduce

  1. Migrate from NX21.2.1 to NX 22.5 for an angular monorepo project (or 22.4, same issue, 22.3 worked fine).
  2. Run the migrations.json file, specifically the "Replace removed matcher aliases in Jest v30 with their corresponding matcher"

Nx Report

Node           : 24.13.0
OS             : linux-x64
Native Target  : x86_64-linux
npm            : 11.6.2

nx                     : 21.2.1
@nx/js                 : 21.2.1
@nx/jest               : 21.2.1
@nx/eslint             : 21.2.1
@nx/workspace          : 21.2.1
@nx/angular            : 21.2.1
@nx/devkit             : 21.2.1
@nx/eslint-plugin      : 21.2.1
@nx/module-federation  : 21.2.1
@nx/plugin             : 21.2.1
@nx/rspack             : 21.2.1
@nx/web                : 21.2.1
@nx/webpack            : 21.2.1
typescript             : 5.8.3
---------------------------------------
Community plugins:
@jsverse/transloco      : 7.6.1
@ngneat/hot-toast       : 5.0.2
@ngrx/component-store   : 19.2.1
@ngrx/effects           : 19.2.1
@ngrx/entity            : 19.2.1
@ngrx/router-store      : 19.2.1
@ngrx/schematics        : 19.2.1
@ngrx/store             : 19.2.1
@ngrx/store-devtools    : 19.2.1
@nx/s3-cache            : 3.0.0
devextreme-angular      : 24.1.3
ng-mocks                : 14.13.4
ngx-bootstrap           : 10.2.0
ngx-extended-pdf-viewer : 15.2.0
---------------------------------------
Cache Usage: 0.00 B / 25.09 GB

Failure Logs

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

Using Ubuntu under Windows wsl

Metadata

Metadata

Assignees

Labels

priority: mediumMedium Priority (not high, not low priority)scope: angularIssues related to Angular support in Nxtype: bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions