Skip to content

fix: restore schematics unit tests under Jest#570

Merged
arturovt merged 1 commit intomasterfrom
schematics-tests
Mar 30, 2026
Merged

fix: restore schematics unit tests under Jest#570
arturovt merged 1 commit intomasterfrom
schematics-tests

Conversation

@arturovt
Copy link
Copy Markdown
Member

  • Mock ora (ESM-only v9+) via moduleNameMapper so @angular-devkit/schematics/testing can be loaded in Jest's CJS environment
  • Add skipConsoleLogging utility and wrap all runSchematic calls to suppress NX warnings from polluting the test terminal
  • Fix updateTSConfig to only update the files field when it already exists (Angular 16+ uses include/exclude instead); add explanatory comments
  • Update issue-249 fixture to inject a files array alongside the Angular 10 comment, accurately simulating the scenario the test was written for
  • Add jest branch to createLogger with a comment explaining the fallback to console.warn

- Mock ora (ESM-only v9+) via moduleNameMapper so @angular-devkit/schematics/testing
  can be loaded in Jest's CJS environment
- Add skipConsoleLogging utility and wrap all runSchematic calls to suppress
  NX warnings from polluting the test terminal
- Fix updateTSConfig to only update the `files` field when it already exists
  (Angular 16+ uses include/exclude instead); add explanatory comments
- Update issue-249 fixture to inject a `files` array alongside the Angular 10
  comment, accurately simulating the scenario the test was written for
- Add jest branch to createLogger with a comment explaining the fallback to console.warn
@arturovt arturovt merged commit f6338cb into master Mar 30, 2026
1 check passed
@arturovt arturovt deleted the schematics-tests branch March 30, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant