Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Disable diagnostic events when running contract tests. #292

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contract-tests/sdkClientEntity.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export { badCommandError };
export function makeSdkConfig(options, tag) {
const cf = {
logger: sdkLogger(tag),
diagnosticOptOut: true
};
const maybeTime = (seconds) =>
seconds === undefined || seconds === null ? undefined : seconds / 1000;
Copy link
Contributor

Choose a reason for hiding this comment

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

Unrelated, but this can be simplified:

Suggested change
seconds === undefined || seconds === null ? undefined : seconds / 1000;
!seconds ? undefined : seconds / 1000;

Copy link
Member Author

@kinyoklion kinyoklion Oct 3, 2023

Choose a reason for hiding this comment

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

0 seconds is falsy.

Copy link
Member Author

Choose a reason for hiding this comment

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

> let seconds = 0;
undefined
> !seconds ? undefined : seconds/1000
undefined
> seconds === undefined || seconds === null ? undefined : seconds/1000
0

I do not know if our test execution does any tests where it sets to 0, but if it does, then the results would be substantially different. As undefined will get default times, and 0 may or may not depending on the check.

Copy link
Member Author

Choose a reason for hiding this comment

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

Now that we are post 8.0 I should convert this to typescript and I could make things like this at least look a little cleaner. This is still the original implementation from Eli, because I wanted to validate compatibility originally.

Expand Down