Bbackstage

backstage/render-test-app-nav-migration

Migrate renderInTestApp nav-item tests to renderTestApp for Backstage 1.51.0

backstagemigrationfrontend-test-utilsrenderInTestApprenderTestAppnav-item1.51.0
Public
0 executions

Run locally

npx codemod @backstage/render-test-app-nav-migration

@backstage/render-test-app-nav-migration

Migrates tests that use renderInTestApp with nav-item features to renderTestApp, which uses the real Backstage app shell in Backstage v1.51+.

Targets tests that passed features with nav-item extensions and asserted on stub sidebar links. Tests that only mount a component with APIs or route refs are left unchanged.

Installation

bash

Usage (from this repo)

bash

Optional: AI fixup step

Enable with --param aiFixup=true to finish test migrations the AST codemod cannot handle mechanically:

  • Remaining renderInTestApp calls with nav features
  • Rewrite sidebar/link assertions for the real app shell
  • Preserve needed mountedRoutes / API options from the original call
  • Skip tests that only use renderInTestApp without nav features

Development

From the repo root:

bash

Or from this package directory:

bash

Ready to contribute?

Build your own codemod and share it with the community.