You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
chore: disable eslint errors for chai assertions - #11833
Currently we set @typescript-eslint/no-unused-expressions to warn, which highlights a lot of errors in our chai assertions. When using both styles of assertion ("expect" and "should"), chai has side-effects which eslint is trying to prevent with this rule.
I disabled this rule for the assertions in the tests via eslint-plugin-chai-friendly, and set it to error in the rest of the code. I also corrected the remaining errors.
Pull-Request Checklist
Code is up-to-date with the master branch
This pull request links relevant issues as Fixes #00000
There are new or updated tests validating the change (tests/**.test.ts)
Documentation has been updated to reflect this change (docs/docs/**.md)
The catch block now unconditionally throws an error even when the try block succeeds. The throw statement at line 992 should be inside the catch block, not after it. This will cause the driver to always fail initialization.
The thick mode initialization logic has been moved outside the conditional check. Lines 996-1000 will execute regardless of whether thickMode is truthy, potentially causing initialization when it shouldn't occur.
The added null checks for msg at lines 1580 and 1585 are redundant since the original code already handled this with short-circuit evaluation. The event handlers are only called when messages exist, making these checks unnecessary.
if(msg){this.connection.logger.log("info",msg.message)}})connection.on("notification",(msg: any)=>{if(msg){this.connection.logger.log("info",`Received NOTIFY on channel ${msg.channel}: ${msg.payload}.`,)}
Why: The suggestion correctly identifies that deep.equal is a stricter assertion than have.members, but it's only a minor improvement as the current test is not incorrect and the order of results is not guaranteed by the query.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of change
Cherry pick of #11700 to the
masterbranch.Currently we set
@typescript-eslint/no-unused-expressionsto warn, which highlights a lot of errors in ourchaiassertions. When using both styles of assertion ("expect" and "should"),chaihas side-effects whicheslintis trying to prevent with this rule.I disabled this rule for the assertions in the tests via
eslint-plugin-chai-friendly, and set it to error in the rest of the code. I also corrected the remaining errors.Pull-Request Checklist
masterbranchFixes #00000tests/**.test.ts)docs/docs/**.md)