-
-
Notifications
You must be signed in to change notification settings - Fork 650
test typescriptification - spec/integ #2714
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
Conversation
…/matrix-client-event-emitter.spec.ts
…x-client-methods.spec.ts
…lient-opts.spec.ts
…/matrix-client-room-timeline.spec.ts
turt2live
left a comment
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.
clearing code review while draft
duxovni
left a comment
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.
The expects that can be compressed into one line are just a nitpick, mostly focused on the un-cleaned-up httpBackends and the ==s.
| // Alice should be tracking bob's device list | ||
| expect(bobStat).toBeGreaterThan( | ||
| 0, "Alice should be tracking bob's device list", | ||
| 0, |
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.
May as well just make this a single line
| // Alice should have marked bob's device list as untracked | ||
| expect(bobStat).toEqual( | ||
| 0, "Alice should have marked bob's device list as untracked", | ||
| 0, |
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.
Likewise
| // Alice should have marked bob's device list as untracked | ||
| expect(bobStat).toEqual( | ||
| 0, "Alice should have marked bob's device list as untracked", | ||
| 0, |
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.
^
| // Alice should have marked bob's device list as untracked | ||
| expect(bobStat).toEqual( | ||
| 0, "Alice should have marked bob's device list as untracked", | ||
| 0, |
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.
^
| expect(expectedEventTypes.indexOf(event.getType())).not.toEqual( | ||
| -1, "Recv unexpected event type: " + event.getType(), | ||
| -1, | ||
| ); |
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.
This can also be a one-liner now
| expect(expectedEventTypes.length).toEqual( | ||
| 0, "Expected to see event types: " + expectedEventTypes, | ||
| 0, | ||
| ); |
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.
And here
duxovni
left a comment
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.
Looks good, there's still the == here but it's a minor nitpick in the context of a test.
| if (!(req.queryParams?.access_token == accessToken || | ||
| req.headers["Authorization"] == "Bearer " + accessToken)) { |
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.
^
The final instalment of test typescriptification 🥳
Fixes #2353
Checklist
This change is marked as an internal change (Task), so will not be included in the changelog.