-
Notifications
You must be signed in to change notification settings - Fork 36
Convert E2E tests to Typescript #257
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
Signed-off-by: Levko Kravets <levko.ne@gmail.com>
Signed-off-by: Levko Kravets <levko.ne@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #257 +/- ##
=======================================
Coverage 93.06% 93.06%
=======================================
Files 65 65
Lines 1586 1586
Branches 280 280
=======================================
Hits 1476 1476
Misses 46 46
Partials 64 64 ☔ View full report in Codecov by Sentry. |
@@ -1,22 +0,0 @@ | |||
const fs = require('fs'); |
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.
We do not have ts counterpart for this?
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.
I removed it because we don't really need custom logging in tests
Signed-off-by: Levko Kravets <levko.ne@gmail.com>
sinon.spy(operation._data, 'fetchNext'); | ||
|
||
const result = await resultHandler.fetchNext({ limit: rowsCount }); | ||
|
||
// @ts-expect-error TS2339: Property _data does not exist on type IOperation |
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.
Are you planning any additional PRs to resolve these type incompatibilities? I assume these comments are like compiler directives saying that we know this property is not part of the type def?
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.
Yes, you're totally correct. Fields marked as private in TS become a regular public fields in JS. And in tests we used this quite a lot to inspect internal state of objects. When convering to TS, I fixed what was easy to fix, and added these @ts-expect-error
directives for non-trivial ones. After we have all the tests in TS, I'll do another iteration and hopefully clean these up
Part of PECO-1390