-
-
Notifications
You must be signed in to change notification settings - Fork 596
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 matrix-org/jest
linting
#2973
Conversation
Pushing this out to a follow-up task, #2976
"jest/valid-expect": "off", | ||
// TODO: There are many cases to refactor away, | ||
// https://github.com/matrix-org/matrix-js-sdk/issues/2978 | ||
"jest/no-conditional-expect": "off", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing locally, everything is passing atm ✅:
$ yarn lint:js
yarn run v1.22.18
$ eslint --max-warnings 0 src spec && prettier --check .
Checking formatting...
All matched files use Prettier code style!
✨ Done in 25.68s.
@@ -2410,31 +2441,6 @@ describe("MatrixClient", function () { | |||
expect(rooms).toContain(room1); | |||
expect(rooms).toContain(room2); | |||
}); | |||
|
|||
it("Ignores m.predecessor if we don't ask to use it", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated test
@@ -292,33 +292,6 @@ describe("Poll", () => { | |||
expect(maySendRedactionForEventSpy).toHaveBeenCalledWith(basePollStartEvent, "@charlie:server.org"); | |||
}); | |||
|
|||
it("does not set poll end event when an earlier end event already exists", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated test
@@ -356,25 +329,6 @@ describe("Poll", () => { | |||
expect(responses.getRelations()).toEqual([responseEventAtEnd, responseEventBeforeEnd]); | |||
}); | |||
|
|||
it("does not set poll end event when sent by invalid user", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated test
@@ -402,43 +356,6 @@ describe("Poll", () => { | |||
expect(poll.isEnded).toBeTruthy(); | |||
}); | |||
|
|||
it("replaces poll end event and refilters when an older end event already exists", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated test
@@ -163,15 +163,6 @@ describe("SimpleHttpRendezvousTransport", function () { | |||
); | |||
}); | |||
|
|||
it("POST with relative path response including parent", async function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rendezvous related changes look good. Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WebRTC changes LGTM
Thanks for bringing this to merge @weeman1337 and for the review @hughns @andybalaam @SimonBrandner 🦧 |
Add
matrix-org/jest
lintingPart of matrix-org/eslint-plugin-matrix-org#33
Follow-up tasks:
jest/valid-expect
: Fixjest/valid-expect
lints throughout the codebase #2976jest/valid-expect-in-promise
: FlawedDeviceList.spec.ts
does not wait for async call and assertions #2977jest/no-conditional-expect
: Fixjest/no-conditional-expect
lints throughout the codebase #2978Todo
eslint-plugin-matrix-org
dependency after Add Jest linting - Add lint to remind you not to leave in an exclusive/focused test eslint-plugin-matrix-org#33 mergesChecklist
This change is marked as an internal change (Task), so will not be included in the changelog.