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
ποΈ Add an eslint rule to prevent misuse of expect #13426
Merged
Merged
Conversation
This file contains 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
@jeffkaufman We can merge this once you send out your PR with the fixes. |
danielrozenberg
approved these changes
Feb 12, 2018
jeffkaufman
added a commit
to jeffkaufman/amphtml
that referenced
this pull request
Feb 12, 2018
None of these were broken tests, just awkward uses of expect caught by the linter in ampproject#13426
rsimha
changed the title
Add an eslint rule to prevent misuse of expect
ποΈ Add an eslint rule to prevent misuse of expect
Feb 13, 2018
rsimha
pushed a commit
that referenced
this pull request
Feb 13, 2018
* fix-tests: expect is not assert With Chai, instead of expect(condition) you need to use expect(variable).stuff.in.english or assert(condition). In cases where the tests were silently failing I've used `iter.skip` for the whole test, or commented out the check if only part of the test was being skipped. (I don't like commenting out code, but is there a better way to skip just a small part of a test?) Addresses #13422 * fix lint error * Fix lint-level misuses of expect. None of these were broken tests, just awkward uses of expect caught by the linter in #13426 * use ideomatic expect, not assert, for comparing strict equality * two more fixes
danielrozenberg
approved these changes
Feb 13, 2018
protonate
pushed a commit
to protonate/amphtml
that referenced
this pull request
Feb 26, 2018
* fix-tests: expect is not assert With Chai, instead of expect(condition) you need to use expect(variable).stuff.in.english or assert(condition). In cases where the tests were silently failing I've used `iter.skip` for the whole test, or commented out the check if only part of the test was being skipped. (I don't like commenting out code, but is there a better way to skip just a small part of a test?) Addresses ampproject#13422 * fix lint error * Fix lint-level misuses of expect. None of these were broken tests, just awkward uses of expect caught by the linter in ampproject#13426 * use ideomatic expect, not assert, for comparing strict equality * two more fixes
protonate
pushed a commit
to protonate/amphtml
that referenced
this pull request
Feb 26, 2018
RanAbram
pushed a commit
to RanAbram/amphtml
that referenced
this pull request
Mar 12, 2018
* fix-tests: expect is not assert With Chai, instead of expect(condition) you need to use expect(variable).stuff.in.english or assert(condition). In cases where the tests were silently failing I've used `iter.skip` for the whole test, or commented out the check if only part of the test was being skipped. (I don't like commenting out code, but is there a better way to skip just a small part of a test?) Addresses ampproject#13422 * fix lint error * Fix lint-level misuses of expect. None of these were broken tests, just awkward uses of expect caught by the linter in ampproject#13426 * use ideomatic expect, not assert, for comparing strict equality * two more fixes
RanAbram
pushed a commit
to RanAbram/amphtml
that referenced
this pull request
Mar 12, 2018
protonate
pushed a commit
to protonate/amphtml
that referenced
this pull request
Mar 15, 2018
* fix-tests: expect is not assert With Chai, instead of expect(condition) you need to use expect(variable).stuff.in.english or assert(condition). In cases where the tests were silently failing I've used `iter.skip` for the whole test, or commented out the check if only part of the test was being skipped. (I don't like commenting out code, but is there a better way to skip just a small part of a test?) Addresses ampproject#13422 * fix lint error * Fix lint-level misuses of expect. None of these were broken tests, just awkward uses of expect caught by the linter in ampproject#13426 * use ideomatic expect, not assert, for comparing strict equality * two more fixes
protonate
pushed a commit
to protonate/amphtml
that referenced
this pull request
Mar 15, 2018
thekorn
pushed a commit
to edelight/amphtml
that referenced
this pull request
Sep 11, 2019
None of these were broken tests, just awkward uses of expect caught by the linter in ampproject#13426
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds a couple of
.eslint
rules to prevent the misuse ofexpect
. The plugin used is https://www.npmjs.com/package/eslint-plugin-chai-expectSee #13422 for why this was necessary, and #13422 (comment) for context around the new lint rules being added by this PR
Follow up to #13424
Fixes #13422