Skip to content

Conversation

@THE-Amrit-mahto-05
Copy link

Fix TypeScript type error test for newUser._id in tsd tests.

The existing test used invalid syntax:

expectError((_id: number) = newUser._id)

This has been replaced with the correct callback syntax:

expectError(() => { const _id: number = newUser._id; });

This ensures that TypeScript correctly flags assignments of ObjectId to number while keeping the tsd tests valid.

Before:
expectError((_id: number) = newUser._id);

After:
expectError(() => {
const _id: number = newUser._id;
});

The previous syntax caused confusion and TypeScript would not correctly catch the type error. This fix aligns the test with valid tsd usage.

@THE-Amrit-mahto-05
Copy link
Author

@vkarpov15 please review my PR

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