Skip to content

Conversation

@Vegapunk-debug
Copy link

Summary

This PR optimizes the test "booleans cause cast error for date (gh-3935)" in test/schema.test.js by removing redundant calls to test.validateSync().
Previously, the test invoked validateSync() twice within its assertions, which was unnecessary.
The updated approach stores the result in validationResult and reuses it, improving test efficiency.

Examples

This is a test-only optimization and does not introduce new features or modify runtime behavior.
No additional examples are required, and the existing test continues to pass with the updated implementation.

Copy link
Collaborator

@vkarpov15 vkarpov15 left a comment

Choose a reason for hiding this comment

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

I appreciate the contribution, but even without the syntax error this PR isn't helpful. Improves performance in tests by the cost of validating a document with 1 path, which is trivial; debatable impact on readability; net negative on consistency because we try to avoid intermediate variables in tests. I'm going to close this one, thanks for the PR though.

@vkarpov15 vkarpov15 closed this Nov 17, 2025
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.

2 participants