Skip to content

Fix test type declarations in global.d.ts#392

Open
rcantin-w wants to merge 1 commit into
mainfrom
fix-test-errors
Open

Fix test type declarations in global.d.ts#392
rcantin-w wants to merge 1 commit into
mainfrom
fix-test-errors

Conversation

@rcantin-w

@rcantin-w rcantin-w commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What does this change?

I don't know about you but all my *.test.ts files were working, but shown as erroring in VSCode (it didn't know what "describe" was or where it came from, for example).

This replaces the import 'jest-extended' side-effect import in api/test/global.d.ts with explicit triple-slash reference directives:

-import 'jest-extended';
+/// <reference types="jest" />
+/// <reference types="jest-extended" />

global.d.ts is a pure declaration file (ambient module augmentation). Using an import statement inside it turns it into a module, which can cause the global type augmentations from jest and jest-extended to not be picked up correctly. Triple-slash references are the correct way to pull in type declarations in an ambient .d.ts file, and also makes the dependency on jest itself explicit.

How to test

Is TS happy? Is your IDE happy? (Might have to restart it)

All tests should pass and no type errors should be reported.

Risks

None — declaration-file only change with no runtime impact.

@rcantin-w rcantin-w requested a review from Copilot July 9, 2026 16:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rcantin-w rcantin-w marked this pull request as ready for review July 9, 2026 16:30
@rcantin-w rcantin-w requested a review from a team as a code owner July 9, 2026 16:30
@rcantin-w rcantin-w moved this from Backlog to Ready for review in Digital experience Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

2 participants