test(devtools): run the orphaned supported-apis spec by erkamyaman · Pull Request #70570 · angular/angular · GitHub
Skip to content

test(devtools): run the orphaned supported-apis spec - #70570

Merged
alxhub merged 1 commit into
angular:mainfrom
erkamyaman:run-supported-apis-spec
Sep 4, 2026
Merged

test(devtools): run the orphaned supported-apis spec#70570
alxhub merged 1 commit into
angular:mainfrom
erkamyaman:run-supported-apis-spec

Conversation

@erkamyaman

Copy link
Copy Markdown
Contributor

supported-apis.spec.ts was added in #60585, in a commit that also edited the ts_test_library three lines below the srcs it was left out of. No revision of that BUILD file has ever listed it, so it has not run since March 2025. The target goes from 12 specs to 14.

Wiring it up alone would not have worked. Every *IsSupported helper calls ngDebugClient(), which throws when window.ng is undefined, and the old expect(supported).toBeTruthy() set no ng at all. It now stubs ng and checks the flag set and that each flag tracks its own debug API.

The beforeEach clears the DOM because ng-debug-api.spec.ts leaves an [ng-version] root behind for getAppRoots() to find under jasmine's random ordering.

glob matches the sibling directive-forest/component-tree target and keeps the next spec in this directory from being dropped the same way.

@pullapprove
pullapprove Bot requested a review from dgp1130 September 4, 2026 08:43
@ngbot ngbot Bot added this to the Backlog milestone Sep 4, 2026
@JeanMeche
JeanMeche requested review from hawkgs and removed request for dgp1130 September 4, 2026 10:10
`supported-apis.spec.ts` was added in angular#60585, in a commit that also edited the
`ts_test_library` three lines below the `srcs` it was left out of. No revision
of that BUILD file has ever listed it, so it has not run since March 2025. The
target goes from 12 specs to 14.

Wiring it up alone would not have worked. Every `*IsSupported` helper calls
`ngDebugClient()`, which throws when `window.ng` is undefined, and the old
`expect(supported).toBeTruthy()` set no `ng` at all. It now stubs `ng` and
checks the flag set and that each flag tracks its own debug API.

`ng-debug-api.spec.ts` adds an `[ng-version]` root and did not remove it, which
`getAppRoots()` then picks up in the other file under jasmine's random
ordering, so it now clears the DOM in its own `afterEach`.

`glob` matches the sibling `directive-forest/component-tree` target and keeps
the next spec in this directory from being dropped the same way.
@erkamyaman
erkamyaman force-pushed the run-supported-apis-spec branch from d1c4ce7 to 26d7318 Compare September 4, 2026 10:35
@erkamyaman
erkamyaman requested a review from hawkgs September 4, 2026 10:36

@hawkgs hawkgs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@hawkgs hawkgs added action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release labels Sep 4, 2026
@erkamyaman

Copy link
Copy Markdown
Contributor Author

@erkamyaman

Copy link
Copy Markdown
Contributor Author

One more thing I noticed while working on this. devtools/projects/shell-browser/src/app/app.component.spec.ts has the same problem: there is no test target for it at all, so it has never run either. That folder has three spec files and only two of them are wired up.

I already have a fix working for it locally. I can send it as a follow-up PR if that is useful. @hawkgs

@hawkgs

hawkgs commented Sep 4, 2026

Copy link
Copy Markdown
Member

We would definitely want to have a working test. 👍 Doesn't make sense to just keep a spec file.

@alxhub
alxhub merged commit 3dfc855 into angular:main Sep 4, 2026
26 of 27 checks passed
@alxhub

alxhub commented Sep 4, 2026

Copy link
Copy Markdown
Member

@erkamyaman
erkamyaman deleted the run-supported-apis-spec branch September 4, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: devtools target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants